#include <bits/stdc++.h>
using namespace std;
int main() {
  int ret = 0;
  for (int i = 0; i < 5; ++i) {
    if (ret % 10 != 0) {
      ret += 10 - (ret % 10);
    }
    int t;
    cin >> t;
    ret += t;
  }
  cout << ret << endl;
  return 0;
}
