#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; const int inf=1<<30; const ll INF=1LL<<62; typedef pair P; typedef pair PP; const ll MOD=998244353; int main(){ ll N; cin>>N; ll ans=0; for(int i=1;i<=N;i++){ if(i%3==1){ ans+=i; }else if(i%3==2){ ans+=1LL*i*i; }else{ ans+=1LL*i*i*i; } } cout<