#!/usr/bin/env python3 #fileencoding: utf-8 N = int(input()) count = 0 count += N // 15 * 4 count += (N // 3 * 2 - N // 15 * 2) count += (N // 5 * 2 - N // 15 * 2) print(count)