#include using namespace std; using ll=long long; using vell=vector; using vs=vector; int main(){ ll N,res; cin>>N; res=0; for (ll i=1;i<=N;i++){ res+=pow(i,(i-1)%3+1); } cout<