#include #include using namespace std; using namespace atcoder; using ll = long long; using ld = long double; using mint = modint998244353; int main() { int N; cin >> N; ll ans = 0; for (ll i = 1; i <= N; i++) { if (i % 3 == 1) ans += i; if (i % 3 == 2) ans += i * i; if (i % 3 == 0) ans += i * i * i; } cout << ans << endl; }