#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> v(5);
  int res = 0;
  for (int i = 0; 5 > i; ++i) cin >> v[i];
  for (int i = 0; 4 > i; ++i) {
    res += v[i] / 10 * 10;
    if (v[i] % 10 > 0) res += 10;
  }
  cout << res + v[4] << endl;
}
