#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define SZ(x) ((int)(x).size())
#define FOR(var, begin, end) for (int var = (begin); var <= (end); var++)
#define RFOR(var, begin, end) for (int var = (begin); var >= (end); var--)
#define REP(var, length) FOR(var, 0, length - 1)
#define RREP(var, length) RFOR(var, length - 1, 0)
#define EACH(value, var) for (auto value : var)
#define SORT(var) sort(var.begin(), var.end())
#define REVERSE(var) reverse(var.begin(), var.end())
#define RSORT(var) SORT(var); REVERSE(var)
#define OPTIMIZE_STDIO ios::sync_with_stdio(false); cin.tie(0); cout.precision(10); cout << fixed
#define endl '\n'

const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;

void solve(istream& cin, ostream& cout) {
  int n;
  cin >> n;
  vector<ll> a(n);
  REP(i, n) {
    cin >> a[i];
    a[i] %= 200;
  }
  SORT(a);
  map<int, ll> mp;
  REP(i, n) mp[a[i]]++;
  ll ans = 0;
  EACH(e, mp) {
    if (e.second == 1) continue;
    ans += (e.second * (e.second - 1)) / 2;
  }
  cout << ans << endl;
}

#ifndef TEST
int main() {
  OPTIMIZE_STDIO;
  solve(cin, cout);
  return 0;
}
#endif

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef pair<int, int> P;

int main(){
    int a, b;
    cin >> a >> b;
    int sa, sb; sa=0; sb=0;
    while(a >= 10){
        //sa = 0;
        sa += a % 10;
        a /= 10;
    }
    sa += a;
    while(b >= 10){
        //sb = 0;
        sb += b % 10;
        b /= 10;
    }
    sb+= b;
    cout << max(sa, sb) << endl;
}
