#include using namespace std; using ll = long long; int main(){ ll N, e, ans=0; cin >> N; vector> p(9, vector(9)); vector cnt(9); for (int i=1; i<=8; i++){ e = 1; for (int j=1; j<=8; j++){ e *= i; p[i][j] = e; } } for (int i=0; i> e; cnt[e]++; } for (int i=1; i<=8; i++){ for (int j=1; j<=8; j++){ ans += cnt[i]*cnt[j]*p[i][j]; } } cout << ans << endl; return 0; }