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