             

#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, from, to) for (int i = from; i < (to); ++i)
#define mp(x,y) make_pair(x,y)
#define all(x) (x).begin(),(x).end()
#define pb push_back
using ll = long long;
using vin=vector<int>;
using vll=vector<ll>;
using vst=vector<string>;
using P = pair<int, int>;
const int inf=1e9+7;
const ll INF=1e18;
template <typename T> void chmin(T &a, T b) { a = min(a, b); }
template <typename T> void chmax(T &a, T b) { a = max(a, b); }
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class T> inline void YES(T condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
const int dx[4] = { 1, 0, -1, 0 };
const int dy[4] = { 0, 1, 0, -1 };
const long double pi=acos(-1);

int main(){cout<<fixed<<setprecision(10);
		   string s;
           cin>>s;
           ll n=s.size();
           //abjka 両端が同じなら数えない
           ll ans=1;
           map<char,ll> cnt;
           rep(i,0,n)cnt[s[i]]++;
           ans+=n*(n-1)/2;
           ll c;
           for(auto v:cnt){
              c=v.second;
            ans-=c*(c-1)/2;
           }
           cout<<ans<<endl;
}

#include <bits/stdc++.h>
#define REP(i, e) for(int (i) = 0; (i) < (e); ++(i))
#define FOR(i, b, e) for(int (i) = (b); (i) < (e); ++(i))
#define ALL(c) (c).begin(), (c).end()
#define PRINT(x) cout << (x) << "\n"
using namespace std;
using ll = long long; using pint = pair<int, int>; using pll = pair<ll, ll>;
const long long MOD = 1000000007;

ll N;
bool prime[55556];
vector<ll> v;

signed main(){
    cin >> N;
    for(ll i = 2; i <= 55555; i++) prime[i] = true;
    for(ll i = 2; i <= 55555; i++){
        if(prime[i] == false) continue;
        if(i % 5 == 1) v.push_back(i);
        for(ll j = 2; i * j <= 55555; j++) prime[i * j] = false;
    }
    REP(i, N){
        cout << v[i];
        if(i == N - 1) cout << endl;
        else cout << " ";
    }
    return 0;
}