#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int ans = 0;
  for (int i = 0; i < (int)(5); i++) {
    int time = 0;
    cin >> time;
    if (time < 10 || i == 4)
      ans += time;
    else
      ans += (time + 9) / 10 * 10;
  }
  cout << ans << endl;
}
