#include using namespace std; using LL = long long; using ULL = unsigned long long; int main() { LL N; cin >> N; cout << (N / 3 + N / 5 - N / 15) * 2 + (N / 15) * 2 << endl; }