stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
/*

    Author: Alam Khan

    AUST CSE 40th Batch



*/



#include<bits/stdc++.h>

using namespace std;



typedef long long ll;

typedef pair<ll,ll> pll;

typedef vector<ll> vl;

typedef deque<ll> dl;

typedef stack<ll> stl;

typedef set<ll> sl;

typedef map<string, ll> msl;

typedef map<ll,ll> mll;

#define sf(n)     scanf("%lld",&n)

#define sff(n,m)     scanf("%lld %lld",&n,&m)

#define sfff(n,m,r)     scanf("%lld %lld %lld",&n,&m,&r)

#define sfs(n)     scanf("%s",n)

#define pf(n)     printf("%lld\n",n)

#define pff(n,m)     printf("%lld %lld\n",n,m)

#define pfff(n,m,r)     printf("%lld %lld %lld\n",n,m,r)

#define pfs(n)     printf("%s\n",n)

#define pfcs(i,n)     printf("Case %lld: %lld\n",i,n)

#define pb     push_back

#define prf     printf

#define inf     2e18

#define low     -1000000000000

#define PI        acos(-1.0)

#define rep1(i,n) for(i=1;i<n;i++)

#define rep0(i,n) for(i=0;i<n;i++)

#define rep(i,a,n) for(i=a;i<n;i++)

#define repe1(i,n) for(i=1;i<=n;i++)

#define repe0(i,n) for(i=0;i<=n;i++)

#define repe(i,a,n) for(i=a;i<=n;i++)

ll a[100009],arr[100009];

map<ll,ll> ma;

vector<ll> v[100009];

ll sol(ll n)

{

    return (n*(n+1))/2;

}

int main()

{

    ll i,n,t,k,j,x=0,y=0,m;

    sff(n,m);

    rep0(i,n)

    {

        sf(x);

        arr[i] = x;

        if(i==0)

            a[i] = x;

        else a[i] = a[i-1]+x;

        a[i] = a[i]%m;

    }

    ll ind = 0;

    for(i=0;i<n;i++)

    {

        if(ma.find(a[i])==ma.end())

        {

            ma[a[i]] = ind++;

        }

        v[ma[a[i]]].push_back(i);

    }

    /*map<ll,ll> :: iterator it;

    for(it=ma.begin();it!=ma.end();it++)

    {

        cout<<it->first<<endl;

        for(i=0;i<v[it->second].size();i++)

        {

            cout<<v[it->second][i]<<" ";

        }

        cout<<endl;

    }*/

    ll ans =0;

    if(ma.find(0)!=ma.end())

    {

        ans+= v[ma[0]].size();

    }

    x = 0;

    ll hi,lo,mid,temp;

    //cout<<"ans = "<<ans<<endl;

    for(i=0;i<n;i++)

    {

        x+= arr[i];

        x = x%m;

        lo = 0;

        hi = v[ma[x]].size()-1;

        temp  = -1;

        while(lo<=hi)

        {

            mid = (lo+hi)/2;

            if(v[ma[x]][mid]>i)

            {

                temp = mid;

                hi = mid-1;

            }

            else lo = mid+1;

        }

        //pff(x,temp);

        //cout<<v[ma[x]].size()<<endl;

        if(temp!=-1)

        {

            ans+= v[ma[x]].size()-temp;

        }

    }

    pf(ans);





    return 0;

}




// Faster C++ solution for the same problem (measured speedup: 3.4614621346448464x):
#include<bits/stdc++.h>

using namespace std;

#define ll long long

map<ll,ll>cnt;



int main()

{

    ios_base::sync_with_stdio(false);

    cin.tie(0);

    int n,i,j,k,l;



    ll sum=0LL,a,m,x;

    cin >> n >> m;

    cnt[0] = 1LL;

    ll ans = 0LL;

    for(i=1;i<=n;i++)

    {

        cin >> a;

        sum += a;

        x = sum%m;

        ans += cnt[x];

        cnt[x]++;



    }

    cout << ans << endl;

}
// Slower C++ solution:
#include<bits/stdc++.h>

#include<algorithm>

using namespace std;

typedef long long unsigned int ll;







int main(){

    int n;

    cin>>n;

    ll m;

    cin>>m;

    ll a[100005];

    for(int i=0;i<n;i++){

        cin>>a[i];

        a[i]%=m;

    }

    

    

    map<ll,ll> mod;

    ll sum[100005]={0};

    

    for(int i=0;i<n;i++){

        sum[i+1]=a[i]+sum[i];

        sum[i+1]%=m;

        

    }

    for(int i=0;i<=n;i++){

        mod[sum[i]]++;

    }

    ll ans=0;

    for(auto i : mod){

        ans += (i.second*(i.second - 1)) / 2;

    }

    

    cout<<ans<<endl;

    return 0;

}




// Faster C++ solution for the same problem (measured speedup: 1.7515048104163433x):
#include<bits/stdc++.h>

#include<algorithm>

using namespace std;

typedef long long unsigned int ll;







int main(){

    int n;

    cin>>n;

    ll m;

    cin>>m;

    ll a[100005];

    for(int i=0;i<n;i++){

        cin>>a[i];

        a[i]%=m;

    }

    

    

    map<ll,ll> mod;

    ll sum[100005];

    sum[0]=0;

    mod[0]=1;

    for(int i=0;i<n;i++){

        sum[i+1]=a[i]+sum[i];

        sum[i+1]%=m;

        mod[sum[i+1]]++;

    }

   

    ll ans=0;

    for(auto i : mod){

        ans += (i.second*(i.second - 1)) / 2;

    }

    

    cout<<ans<<endl;

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

#include<algorithm>

using namespace std;

typedef long long unsigned int ll;







int main(){

    int n;

    cin>>n;

    ll m;

    cin>>m;

    ll a[100005];

    for(int i=0;i<n;i++){

        cin>>a[i];

        a[i]%=m;

    }

    

    

    map<ll,ll> mod;

    ll sum[100005]={0};

    

    for(int i=0;i<n;i++){

        sum[i+1]=a[i]+sum[i];

        sum[i+1]%=m;

        

    }

    mod[0]=1;

    for(int i=1;i<=n;i++){

        mod[sum[i]]++;

    }

    ll ans=0;

    for(auto i : mod){

        ans += (i.second*(i.second - 1)) / 2;

    }

    

    cout<<ans<<endl;

    return 0;

}




// Faster C++ solution for the same problem (measured speedup: 1.7511860373650416x):
#include<bits/stdc++.h>

#include<algorithm>

using namespace std;

typedef long long unsigned int ll;







int main(){

    int n;

    cin>>n;

    ll m;

    cin>>m;

    ll a[100005];

    for(int i=0;i<n;i++){

        cin>>a[i];

        a[i]%=m;

    }

    

    

    map<ll,ll> mod;

    ll sum[100005];

    sum[0]=0;

    mod[0]=1;

    for(int i=0;i<n;i++){

        sum[i+1]=a[i]+sum[i];

        sum[i+1]%=m;

        mod[sum[i+1]]++;

    }

   

    ll ans=0;

    for(auto i : mod){

        ans += (i.second*(i.second - 1)) / 2;

    }

    

    cout<<ans<<endl;

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

#include<algorithm>

using namespace std;

typedef long long unsigned int ll;







int main(){

    int n;

    cin>>n;

    ll m;

    cin>>m;

    ll a[100005];

    for(int i=0;i<n;i++){

        cin>>a[i];

        a[i]%=m;

    }

    

    

    map<ll,ll> mod;

    ll sum[100005]={0};

    mod[0]=1;

    for(int i=0;i<n;i++){

        sum[i+1]=a[i]+sum[i];

        sum[i+1]%=m;

        mod[sum[i+1]]++;

    }

    

    /*for(int i=1;i<=n;i++){

        mod[sum[i]]++;

    }*/

    ll ans=0;

    for(auto i : mod){

        ans += (i.second*(i.second - 1)) / 2;

    }

    

    cout<<ans<<endl;

    return 0;

}




// Faster C++ solution for the same problem (measured speedup: 1.7511319822409124x):
#include<bits/stdc++.h>

#include<algorithm>

using namespace std;

typedef long long unsigned int ll;







int main(){

    int n;

    cin>>n;

    ll m;

    cin>>m;

    ll a[100005];

    for(int i=0;i<n;i++){

        cin>>a[i];

        a[i]%=m;

    }

    

    

    map<ll,ll> mod;

    ll sum[100005];

    sum[0]=0;

    mod[0]=1;

    for(int i=0;i<n;i++){

        sum[i+1]=a[i]+sum[i];

        sum[i+1]%=m;

        mod[sum[i+1]]++;

    }

   

    ll ans=0;

    for(auto i : mod){

        ans += (i.second*(i.second - 1)) / 2;

    }

    

    cout<<ans<<endl;

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

#include<algorithm>

using namespace std;

typedef long long unsigned int ll;







int main(){

    int n;

    cin>>n;

    ll m;

    cin>>m;

    ll a[100005];

    for(int i=0;i<n;i++){

        cin>>a[i];

        a[i]%=m;

    }

    

    

    map<ll,ll> mod;

    ll sum[100005]={0};

    

    for(int i=0;i<n;i++){

        sum[i+1]=a[i]+sum[i];

        sum[i+1]%=m;

        

    }

    for(int i=0;i<=n;i++){

        mod[sum[i]]++;

    }

    ll ans=0;

    for(auto i : mod){

        ans += (i.second*(i.second - 1)) / 2;

    }

    

    cout<<ans<<endl;

    return 0;

}




// Faster C++ solution for the same problem (measured speedup: 1.7513938137070166x):
#include<bits/stdc++.h>

#include<algorithm>

using namespace std;

typedef long long unsigned int ll;







int main(){

    int n;

    cin>>n;

    ll m;

    cin>>m;

    ll a[100005];

    for(int i=0;i<n;i++){

        cin>>a[i];

        a[i]%=m;

    }

    

    

    map<ll,int> mod;

    ll sum[100005];

    sum[0]=0;

    mod[0]=1;

    for(int i=0;i<n;i++){

        sum[i+1]=a[i]+sum[i];

        sum[i+1]%=m;

        mod[sum[i+1]]++;

    }

   

    ll ans=0;

    ll b;

    for(auto i : mod){

        b=i.second;

        b*=i.second-1;

        b/=2;

        ans+=b;

    }

    

    cout<<ans<<endl;

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

#include<algorithm>

using namespace std;

typedef long long unsigned int ll;







int main(){

    int n;

    cin>>n;

    ll m;

    cin>>m;

    ll a[100005];

    for(int i=0;i<n;i++){

        cin>>a[i];

        a[i]%=m;

    }

    

    

    map<ll,ll> mod;

    ll sum[100005]={0};

    

    for(int i=0;i<n;i++){

        sum[i+1]=a[i]+sum[i];

        sum[i+1]%=m;

        

    }

    mod[0]=1;

    for(int i=1;i<=n;i++){

        mod[sum[i]]++;

    }

    ll ans=0;

    for(auto i : mod){

        ans += (i.second*(i.second - 1)) / 2;

    }

    

    cout<<ans<<endl;

    return 0;

}




// Faster C++ solution for the same problem (measured speedup: 1.751075060857064x):
#include<bits/stdc++.h>

#include<algorithm>

using namespace std;

typedef long long unsigned int ll;







int main(){

    int n;

    cin>>n;

    ll m;

    cin>>m;

    ll a[100005];

    for(int i=0;i<n;i++){

        cin>>a[i];

        a[i]%=m;

    }

    

    

    map<ll,int> mod;

    ll sum[100005];

    sum[0]=0;

    mod[0]=1;

    for(int i=0;i<n;i++){

        sum[i+1]=a[i]+sum[i];

        sum[i+1]%=m;

        mod[sum[i+1]]++;

    }

   

    ll ans=0;

    ll b;

    for(auto i : mod){

        b=i.second;

        b*=i.second-1;

        b/=2;

        ans+=b;

    }

    

    cout<<ans<<endl;

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

#include<algorithm>

using namespace std;

typedef long long unsigned int ll;







int main(){

    int n;

    cin>>n;

    ll m;

    cin>>m;

    ll a[100005];

    for(int i=0;i<n;i++){

        cin>>a[i];

        a[i]%=m;

    }

    

    

    map<ll,ll> mod;

    ll sum[100005]={0};

    mod[0]=1;

    for(int i=0;i<n;i++){

        sum[i+1]=a[i]+sum[i];

        sum[i+1]%=m;

        mod[sum[i+1]]++;

    }

    

    /*for(int i=1;i<=n;i++){

        mod[sum[i]]++;

    }*/

    ll ans=0;

    for(auto i : mod){

        ans += (i.second*(i.second - 1)) / 2;

    }

    

    cout<<ans<<endl;

    return 0;

}




// Faster C++ solution for the same problem (measured speedup: 1.7510210091585268x):
#include<bits/stdc++.h>

#include<algorithm>

using namespace std;

typedef long long unsigned int ll;







int main(){

    int n;

    cin>>n;

    ll m;

    cin>>m;

    ll a[100005];

    for(int i=0;i<n;i++){

        cin>>a[i];

        a[i]%=m;

    }

    

    

    map<ll,int> mod;

    ll sum[100005];

    sum[0]=0;

    mod[0]=1;

    for(int i=0;i<n;i++){

        sum[i+1]=a[i]+sum[i];

        sum[i+1]%=m;

        mod[sum[i+1]]++;

    }

   

    ll ans=0;

    ll b;

    for(auto i : mod){

        b=i.second;

        b*=i.second-1;

        b/=2;

        ans+=b;

    }

    

    cout<<ans<<endl;

    return 0;

}
// Slower C++ solution:
#include<iostream>

#include<stdio.h>

//#include <bits/stdc++.h>

#include<vector>

#include<float.h>

#include<iomanip>

#include<algorithm>

#include<string>

#include<cstring>

#include<math.h>

#include<cmath>

#include<sstream>

#include<set>

#include<map>

#include<queue>

#include <cassert>

#include <cmath>

#include<cstdint>



#define INF 1e9

#define rep(i,n)for(int i=0;(i)<(int)(n);i++)

#define REP(i,a,b)for(int i=(int)(a);(i)<=(int)(b);i++)

#define VEC(type, c, n) std::vector<type> c(n);for(auto& i:c)std::cin>>i;

#define vec(type,n) vector<type>(n)

#define vvec(m,n) vector<vector<int>> (int(m),vector<int>(n))

#define ALL(a)  (a).begin(),(a).end()





using namespace std;

using ll = long long;

using Graph = vector<vector<int>>;

using P = pair<ll, ll>;



struct edge{

    int to;

    int dist;

};



vector<bool> seen(100000, false);

vector<int> pnt(100000, INF);

vector<vector<edge>> G(100000);

int n, m;

bool f = true;





void dfs(int v, int dist){

    seen[v] = true;

    if(pnt[v] == INF)pnt[v] = dist;

    else {

        if(pnt[v] != dist)f = false;

        return;

    }



    for(int i = 0; i < (int)(G[v].size()); i++){

        edge e = G[v][i];

        if(pnt[e.to] != INF && pnt[e.to] != pnt[v] + e.dist){

            f = false;

            return;

        }

        if(seen[e.to])continue;

        dfs(e.to, e.dist + pnt[v]);

    }

}



int main(){

    ll n, m;

    cin >> n >> m;

    vector<ll> rui(n + 1, 0);

    rep(i, n){

        ll a;

        cin >> a;

        rui[i + 1] = rui[i] + a;

    }

    ll res = 0;

    REP(i, 1, n){

        rui[i] %= m;

        if(rui[i] == 0)res++;

    }

    map<ll, ll> mp;

    REP(i, 1, n)mp[rui[i]]++;



    for(auto m : mp){

        res += m.second * (m.second - 1) / 2;

    }

    cout << res << endl;

}


// Faster C++ solution for the same problem (measured speedup: 3.930162761602069x):
#include<iostream>

#include<stdio.h>

//#include <bits/stdc++.h>

#include<vector>

#include<float.h>

#include<iomanip>

#include<algorithm>

#include<string>

#include<cstring>

#include<math.h>

#include<cmath>

#include<sstream>

#include<set>

#include<map>

#include<queue>

#include <cassert>

#include <cmath>

#include<cstdint>



#define INF 1e9

#define rep(i,n)for(int i=0;(i)<(int)(n);i++)

#define REP(i,a,b)for(int i=(int)(a);(i)<=(int)(b);i++)

#define VEC(type, c, n) std::vector<type> c(n);for(auto& i:c)std::cin>>i;

#define vec(type,n) vector<type>(n)

#define vvec(m,n) vector<vector<int>> (int(m),vector<int>(n))

#define ALL(a)  (a).begin(),(a).end()





using namespace std;

using ll = long long;

using Graph = vector<vector<int>>;

using P = pair<ll, ll>;







int main(){

    int n, m;

    cin >> n >> m;

    vector<ll> v(n);

    map<ll, ll>mp;

    ll res = 0;

    rep(i, n){

        int a;

        cin >> a;

        if(i == 0)v[i] = a;

        else v[i] = v[i - 1] + a;

        v[i] %= m;

        mp[v[i]]++;

        if(v[i] == 0)res++;

    }

    for(auto m : mp){

        res += (m.second) * (m.second - 1) / 2;

    }

    cout << res << endl;

}
// Slower C++ solution:
#include<bits/stdc++.h>

#include<tuple>

using namespace std;

#define ll long long

int main(){

  int n, m;

  ll a[100000], b[100001] = {}, ans = 0;

  map<ll, ll> d;

  cin >> n >> m;

  d[0]++;

  for(int i=0;i<n;i++){

    cin >> a[i];

    b[i+1] = (a[i] + b[i]) % m; 

    d[b[i+1]]++;

  }

  for(map<ll, ll>::iterator iter = d.begin();iter !=d.end();iter++){

    ans += (iter->second * (iter->second -1)) / 2;

  }

  cout << ans << endl;

}

// Faster C++ solution for the same problem (measured speedup: 1.8150230854495664x):
#include<bits/stdc++.h>

using namespace std;

#define ll long long

int main(){

  int n, m;

  int a, buf = 0;

  ll ans = 0;

  map<int, int> d;

  cin >> n >> m;

  d[0]++;

  for(int i=0;i<n;i++){

    cin >> a;

    buf = (a + buf) % m; 

    d[buf]++;

  }

  for(map<int, int>::iterator iter = d.begin();iter !=d.end();iter++){

    ll cnt = iter->second;

    ans += (cnt * (cnt - 1)) / 2;

  }

  cout << ans << endl;

}
// Slower C++ solution:
#include <bits/stdc++.h>

#define LL long long int

using namespace std;



LL sum[100010];

LL a[100010];

map<LL,LL> Q;



int main()

{

    LL n,m;

    while(scanf("%lld%lld",&n,&m)!=EOF)

    {

        Q.clear();

        sum[0]=0;

        LL ans=0;

        for(LL i=1;i<=n;i++)

        {

            scanf("%I64d",&a[i]);

            sum[i]=sum[i-1]+a[i];

            sum[i]%=m;

            Q[sum[i]]++;

        }

        Q[0]++;

        map<LL,LL>::iterator it=Q.begin();

        while(it!=Q.end())

        {

            ans+=(it->second)*(it->second-1)/2;

            it++;

        }

        printf("%lld\n",ans);

    }

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.1827970311071745x):
#include<stdio.h>

#include<algorithm>

#define ll long long

#define maxn 100010

using namespace std;



ll pre[maxn];

ll a[maxn];



int main()

{

    ll i,n,m,t = 1,sum = 0;



    scanf("%lld%lld",&n,&m);

    pre[0] = 0;

    for(i = 1; i <= n; i++)

    {

        scanf("%lld",&a[i]);

        pre[i] = (pre[i-1]+a[i])%m;

    }

    sort(pre+1,pre+n+1);



    for(i = 1; i <= n; i++)

    {

        if(pre[i] == pre[i-1])

            t++;

        else

        {

            sum += t*(t-1)>>1;

            t = 1;

        }

    }

    sum += t*(t-1)>>1;

    printf("%lld\n",sum);



    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>



using namespace std;



long long memo[100010];



long long sum(int x) {

  if (memo[x] != -1) return memo[x];

  return memo[x] = x + sum(x - 1);

}



int main() {

  ios::sync_with_stdio(false);

  cin.tie(0);

  for (int i = 0; i < 100010; i++) memo[i] = -1;

  memo[0] = 0;

  memo[1] = 1;

  int n, m;

  cin >> n >> m;

  vector<int> a(n + 1, 0);

  for (int i = 1; i <= n; i++) cin >> a[i];

  map<int, int> mp;

  for (int i = 1; i <= n; i++) {

    a[i] = (a[i] + a[i - 1]) % m;

  }

  for (int i = 1; i <= n; i++) {

    mp[a[i]]++;

  }

  long long ans = 0;

  for (auto kv: mp) {

    if (kv.first == 0) {

      ans += sum(kv.second);

    } else {

      ans += sum(kv.second - 1);

    }

  }

  cout << ans << endl;

  return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.7785743318391078x):
#include <bits/stdc++.h>



#define rep(i, n) for (int i = 0; i < int(n); i++)

#define rrep(i, n) for (int i = int(n) - 1; i >= 0; i--)

#define reps(i, n) for (int i = 1; i <= int(n); i++)

#define rreps(i, n) for (int i = int(n); i >= 1; i--)

#define repi(i, a, b) for (int i = (a); i < int(b); i++)

#define all(a) (a).begin(), (a).end()

#define bit(b) (1ull << (b))



using namespace std;

using i32 = int;

using i64 = long long;

using f64 = double;

using vi32 = vector<i32>;

using vi64 = vector<i64>;

using vf64 = vector<f64>;

using vstr = vector<string>;



template<typename T, typename S> void amax(T &x, S y) { if (x < y) x = y; }

template<typename T, typename S> void amin(T &x, S y) { if (y < x) x = y; }



int main() {

  ios::sync_with_stdio(false);

  cin.tie(0);

  cout << fixed << setprecision(16);

  i32 n, m; cin >> n >> m;

  vi64 a(n); rep(i, n) cin >> a[i];

  vi64 sums(n + 1, 0);

  rep(i, n) sums[i + 1] = (sums[i] + a[i]) % m;

  map<i64, i64> mp;

  rep(i, n + 1) mp[sums[i]]++;

  i64 ans = 0;

  for (auto v: mp) {

    ans += v.second * (v.second - 1) / 2;

  }

  cout << ans << endl;

  return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

int main () {

	int a,b;

	scanf("%d", &a);

	b=a*800-a/15*200;

	printf("%d\n",b);

}

// Faster C++ solution for the same problem (measured speedup: 5.210707770778849x):
#include<stdio.h>

int main()

{

	int N,x,y,s,a;

	1<=N<=100;

	scanf("%d",&N);

	s=N/15;

	x=800*N;

	y=200*s;

	a=x-y;

	printf("%d",a);

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



int a;



int main(){

	cin>>a;

	cout<<a*800-floor(a/15)*200<<endl;

}


// Faster C++ solution for the same problem (measured speedup: 5.339768641781441x):
#include<stdio.h>

int main()

{

	int N,x,y,s,a;

	1<=N<=100;

	scanf("%d",&N);

	s=N/15;

	x=800*N;

	y=200*s;

	a=x-y;

	printf("%d",a);

	return 0;

}
// Slower C++ solution:
#include <iostream>



using namespace std;



int main()

{

    int n,x ;

    cin >> n;

    x=n/15;

    cout << (n*800)-(x*200) ;



    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.222262398828746x):
#include<stdio.h>

int main()

{

	int N,x,y,s,a;

	1<=N<=100;

	scanf("%d",&N);

	s=N/15;

	x=800*N;

	y=200*s;

	a=x-y;

	printf("%d",a);

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

int x,y,n;



int main () {

	cin >> n;

	x=800*n;y=n/15*200;n=x-y;

	cout << n << endl;



}

// Faster C++ solution for the same problem (measured speedup: 5.2744404956579745x):
#include<stdio.h>

int main()

{

	int N,x,y,s,a;

	1<=N<=100;

	scanf("%d",&N);

	s=N/15;

	x=800*N;

	y=200*s;

	a=x-y;

	printf("%d",a);

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

int N;

int main(){

    cin>>N;

    cout<<800*N-200*(N/15)<<endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.272952813313577x):
#include<stdio.h>

int main()

{

	int N,x,y,s,a;

	1<=N<=100;

	scanf("%d",&N);

	s=N/15;

	x=800*N;

	y=200*s;

	a=x-y;

	printf("%d",a);

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main()

{

   int n,p,q;

   cin>>n;

   q=n/15;

   p=n*800-200*q;



   cout<<p<<endl;

}


// Faster C++ solution for the same problem (measured speedup: 5.272183882260569x):
#include<stdio.h>

int main()

{

	int N,x,y,s,a;

	1<=N<=100;

	scanf("%d",&N);

	s=N/15;

	x=800*N;

	y=200*s;

	a=x-y;

	printf("%d",a);

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

int main () {

	int a,b;

	scanf("%d", &a);

	b=a*800-a/15*200;

	printf("%d\n",b);

}

// Faster C++ solution for the same problem (measured speedup: 5.209339247088125x):
#include<stdio.h>

int func(int n)

{

	int fee;

	fee=n*800-(n/15)*200;

	return fee;

}

int main()

{

	int x;

	scanf("%d",&x);

	printf("%d",func(x));

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



int a;



int main(){

	cin>>a;

	cout<<a*800-floor(a/15)*200<<endl;

}


// Faster C++ solution for the same problem (measured speedup: 5.338366221954667x):
#include<stdio.h>

int func(int n)

{

	int fee;

	fee=n*800-(n/15)*200;

	return fee;

}

int main()

{

	int x;

	scanf("%d",&x);

	printf("%d",func(x));

	return 0;

}
// Slower C++ solution:
#include <iostream>



using namespace std;



int main()

{

    int n,x ;

    cin >> n;

    x=n/15;

    cout << (n*800)-(x*200) ;



    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.220890840467317x):
#include<stdio.h>

int func(int n)

{

	int fee;

	fee=n*800-(n/15)*200;

	return fee;

}

int main()

{

	int x;

	scanf("%d",&x);

	printf("%d",func(x));

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

int x,y,n;



int main () {

	cin >> n;

	x=800*n;y=n/15*200;n=x-y;

	cout << n << endl;



}

// Faster C++ solution for the same problem (measured speedup: 5.273055233407403x):
#include<stdio.h>

int func(int n)

{

	int fee;

	fee=n*800-(n/15)*200;

	return fee;

}

int main()

{

	int x;

	scanf("%d",&x);

	printf("%d",func(x));

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

int N;

int main(){

    cin>>N;

    cout<<800*N-200*(N/15)<<endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.2715679417831565x):
#include<stdio.h>

int func(int n)

{

	int fee;

	fee=n*800-(n/15)*200;

	return fee;

}

int main()

{

	int x;

	scanf("%d",&x);

	printf("%d",func(x));

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main()

{

   int n,p,q;

   cin>>n;

   q=n/15;

   p=n*800-200*q;



   cout<<p<<endl;

}


// Faster C++ solution for the same problem (measured speedup: 5.270799212679751x):
#include<stdio.h>

int func(int n)

{

	int fee;

	fee=n*800-(n/15)*200;

	return fee;

}

int main()

{

	int x;

	scanf("%d",&x);

	printf("%d",func(x));

	return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;



int main() {

	int N, x, y;

	cin >> N;

	y = N / 15 * 200;

	x = N * 800;

	cout << x - y << endl;

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.25369819983441x):
#include <cstdio>

#include <cstdlib>

#include <cstring>

#include <string>

#include <cmath>

#include <algorithm>

#include <vector>

#include <map>

#include <queue>

#include <set>

using namespace std;

typedef long long LL;

const int MaxN = 1e5;

const int Inf = 1 << 30;



int main()

{

	int N;

	while(~scanf("%d",&N)){

		printf("%d\n",800 * N - N / 15 * 200);

	}

    return 0;

}