n = int(input()) count = 0 while n > 0: if n % 15 == 0: count += 4 n -= 1 continue if n % 3 == 0 or n % 5 == 0: count += 2 n -= 1 print(count)