#!/usr/bin/env python # -*- coding: utf-8 -*- def main(): n = int(input()) fizzbuzz = int(n / 15) fizz = int(n / 3) - fizzbuzz buzz = int(n / 5) - fizzbuzz result = fizzbuzz * 4 + fizz * 2 + buzz * 2 print(result) if __name__ == '__main__': main()