def wc(filename):
    """Counts and returns the number of words in the specified file."""
    f = open(filename, 'r')
    lines = f.readlines()
    words = []
    for line in lines:
        words += line.split(" ")
    for i in range(words.count("\n")):
        words.remove("\n")
    return len(words)