while True:
    try:
        a = int(input())
        res = 0
        for i in range(1,a+1):
            s=0
            for j in range(1,i//2+1):
                if i%j == 0:
                    s=s+j
            if s== i:
                res =res+1
        
        print(res)
    except:
        break