#include using ll = long long; using namespace std; int main() { ll N; cin >> N; ll res = N / 15 * 16; for(int i=1; i<=N%15; ++i) { if(i % 3 == 0 || i % 5 == 0) { res += 2; } } cout << res << endl; }