#include <bits/stdc++.h>
using namespace std;
int main() {
  int m = 11, N, count = 0;
  cin >> N;
  int a[N];
  for (int i = 0; i < N; i++) {
    cin >> a[i];
    count += m % a[i];
  }
  cout << count << endl;
  return 0;
}
