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