#include <bits/stdc++.h>
using namespace std;
const int INF = 999999;
const double EPS = 1e-10;
const double PI = acos(-1.0);
const long long MOD = 1000000007;
int sum = 0;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  bool flag = true;
  int x;
  cin >> x;
  int y;
  for (int i = (0); i < (x); ++i) {
    cin >> y;
    sum += y % 11;
  }
  cout << sum << endl;
  return 0;
}
