#include "bits/stdc++.h"
#include "random"
#include <unistd.h>

using namespace std;

#define ll long long
#define vi vector<int>
#define vl vector<long long>
#define vvi vector<vi>
#define pi  pair<int,int>
#define mp  make_pair
#define pb  push_back
#define MOD int(1e9) + 7
#define PAI  3.1415926535
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define chmax(x, y) x = max(x,y)
#define chmin(x, y) x = min(x,y)
#define pr(x) cout << x << endl
#define Endl endl
#define rep(i, n) for(int i = 0 ; i < n; ++i)

const int dx2[4] = {0,1,0,1};
const int dy2[4] = {0,0,1,1};
const int dx[4] = {1,0,-1,0};
const int dy[4] = {0,1,0,-1};
const int ddx[8] = {-1,0,1,-1,1,-1,0,1};
const int ddy[8] = {-1,-1,-1,0,0,1,1,1};
const int inf = 99999999;
const ll linf = 1LL << 62;

ll gcd(ll a,ll b){
  if(a < b)swap(a , b);
  if(a % b != 0) return(gcd(b, a%b));
  return b;
}

ll lcm(ll a,ll b){
  if(a < b)swap(a , b);
  return (a / gcd(a , b)) * b;
}

int Uniform_Random(int a, int b){ // (a <= x <= b)

  random_device rd;
  mt19937 mt(rd());
  
  uniform_int_distribution<int> rv1(a, b);
  return rv1(mt); 
}


int main(){
  
  ll N; cin >> N;
  ll ans = N;
  set<ll> st;
  for(ll i = 2; i <= sqrt(N); ++i){
    ll cnt = 2;
    if(st.find(i) == st.end()){
      while(pow(i, cnt) <= N){
        st.insert(pow(i, cnt));
        ans --;
        cnt ++;
      }
    }
  }

  cout << ans << endl;

  return 0;
}
/********************************************************************
*                                                                   *
*                                                                   *
*                         Coded By colin!                           *
*                                                                   *
*                                                                   *
********************************************************************/

#include<bits/stdc++.h>
#define fastio ios_base::sync_with_stdio(0)
typedef long long ll;
using namespace std;

ll gcd(ll a, ll b){
    if(b==0)return a;
    else return gcd(b,a%b);
}

ll lcm(ll a, ll b){
    return a*b/gcd(a,b);
}

ll nCr(ll n, ll r){ 
    if(n==r||r==0)
    {
        return 1;
    }
    return nCr(n-1,r-1)+nCr(n-1,r);
}

ll nPr(ll n, ll r){ 
    ll i,per=1;
    for(i=n; i>=n-r+1; i--)
    {
        per*=i;
    }
    return per;
}

ll catalan(ll n){
    return nCr(2*n,n) / (n+1);
}   

int main()
{
	int n; cin>>n;
	ll cnt=0;
	int arr[200005];
	ll na[201]={0};
	for(int i=0;i<n;i++)
	{
		scanf("%d",&arr[i]);
		na[arr[i]%200]++;
	}
	for(int j=0;j<200;j++)
    {
      cnt=cnt+(na[j]*(na[j]-1))/2;
    }
	printf("%lld",cnt);
}