#include <bits/stdc++.h>
using namespace std;
const long long int INF = 99999999999999999;
const long long int MAX_N = 100010;
long long int a, b, c, d, e, x, y, m, n, l, q, ans = 0;
vector<long long int> v, v1, v2;
int main() {
  cin >> a >> b >> c >> d >> e;
  v.push_back(a % 10);
  v.push_back(b % 10);
  v.push_back(c % 10);
  v.push_back(d % 10);
  v.push_back(e % 10);
  sort(v.begin(), v.end());
  cout << (a - 1) / 10 + (b - 1) / 10 + (c - 1) / 10 + (d - 1) / 10 +
              (e - 1) / 10 + 50 + v[0]
       << endl;
}
