#!/usr/bin/python # -*- coding: utf-8 -*- N = int(raw_input()) print N / 15 * 4 + ( N / 3 - N /15) * 2 + ( N / 5 - N /15) * 2