#include <bits/stdc++.h>
using namespace std;
int main() {
  int ans = 0, a, tmp = 1000;
  for (long long i = 0; i < (5); i++) {
    cin >> a;
    ans += a - a / 10;
    ans += (a % 10 == 0) ? 0 : 1;
    tmp = min(tmp, a % 10);
  }
  if (tmp != 0) ans = ans + tmp - 10;
  cout << ans << endl;
}
