//#define __USE_MINGW_ANSI_STDIO 0
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef pair<int, int> PII;

#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
#define IN(a, b, x) (a<=x&&x<b)
#define MP make_pair
#define PB push_back
#define MOD 1000000007
#define INF (1LL<<30)
#define LLINF (1LL<<60)
#define PI 3.14159265359
#define EPS 1e-12
//#define int ll

signed main(void)
{
	int d;
	while(cin >> d) {
		ll sum = 0;
		for(int i=d; i<=600-d; i+=d) {
			sum += d*i*i;
		}
		cout << sum << endl;
	}

	return 0;
}
#include<iostream>
#include<cstdio>
#include<stack>
using namespace std;
 
int main(){
    string str ;
    while ( cin >> str ){
        int len = str.size() ;
        stack<char> container ;
        for ( int i = 0 ; i < str.size() ; i ++ ){
            if ( str[i] == 'T' ){
                if ( !container.empty() ){
                    if ( container.top() == 'S' ){
                        len -= 2 ;
                        container.pop() ;
                    }
                }else{
                    container.push(str[i]) ;
                }
            }else{
                container.push(str[i]) ;
            }
        }
        cout << len << endl ;
    }
    return 0 ;
}