#! /usr/bin/python
import sys

def leeEntrada():
    count = 0
    for line in sys.stdin:
        count = count + 1
        print "Linea: [{0}]".format(line)
    print "leidas {0} lineas".format(count)


def leeEntrada2():
    count = 0
    try:
        while (True):
            line = raw_input()
            count = count + 1
            print "Linea: [{0}]".format(line)
    except (EOFError):
        pass
    
    print "leidas {0} lineas".format(count)
   

def leeArchivo(file):
    print "leyendo archivo: {0}".format(file)
    count = 0
    for line in open(file, "r"):
        count = count + 1
        print "Linea: [{0}]".format(line)
    print "leidas {0} lineas".format(count)


def main1():
    leeEntrada1()


def main2():
    leeEntrada2()


def main1():
    if (len(sys.argv) < 2):
        print "ERROR. Argumento (file) faltante"
        return
    leeArchivo(sys.argv[1])



if __name__ == "__main__":
    main()

