#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
const long long INF = 1010000000;
const double EPS = 1e-10;
const pair<long long, long long> fd[] = {make_pair(1, 0), make_pair(-1, 0),
                                         make_pair(0, 1), make_pair(0, -1)};
vector<long long> init(long long size) {
  vector<long long> par(size, -1);
  return par;
}
long long root(long long x, vector<long long>& par) {
  if (par[x] < 0) {
    return x;
  } else {
    return par[x] = root(par[x], par);
  }
}
bool same(long long x, long long y, vector<long long>& par) {
  return root(x, par) == root(y, par);
}
void unite(long long x, long long y, vector<long long>& par) {
  x = root(x, par), y = root(y, par);
  if (same(x, y, par)) return;
  par[x] += par[y];
  par[y] = x;
}
long long size(long long x, vector<long long>& par) {
  return -par[root(x, par)];
}
long long pow(long long x, long long n) {
  if (n == 0) return 1;
  if (n % 2 == 0)
    return pow(x * x % MOD, n / 2);
  else
    return x * pow(x, n - 1) % MOD;
}
signed main() {
  double a[5];
  for (long long i = (0); i < (5); i++) cin >> a[i];
  long long b[5];
  for (long long i = (0); i < (5); i++) {
    b[i] = ceil(a[i] / 10) * 10;
  }
  long long ans = 0;
  for (long long i = (0); i < (5); i++) {
    ans += b[i];
  }
  cout << ans << endl;
}
