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