def main(): n = int(input()) nums = range(1, n + 1) count = 0 for num in nums: if num % 3 == 0 and num % 5 == 0: count += 4 elif num % 3 == 0: count += 2 elif num % 5 == 0: count += 2 print(count) if __name__ == "__main__": main()