#Programmer: Sriram Pemmaraju
#Date: March 2nd, 2011

#Returns true if the given string s contains the character 7
def containsSeven(s):
    return "7" in s

#Illustrates the use of map and filter; it constructs a list of
#all numbers in the range 0 through 1000 that contain 7 and prints
# the length of this list
print len(filter(containsSeven, map(str, range(1001))))