num = int(input()) sm = 0 for m in range(1, num + 1): tmp = 0 for n in range(1, m): if m % n == 0: tmp += n if tmp == m: sm += 1 print(sm)