#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, d, e;
  int time;
  cin >> a >> b >> c >> d >> e;
  vector<int> t(5);
  t = {a, b, c, d, e};
  vector<int> s(5);
  s = {a, b, c, d, e};
  for (int i = 0; i < 4; i++) {
    while (t.at(i) > 1) {
      t.at(i) = t.at(i) % 10;
    }
    time += t.at(i);
  }
  for (int i = 0; i < 5; i++) {
    time += s.at(i);
  }
  cout << time << endl;
  return 0;
}
