#include <bits/stdc++.h>
using namespace std;
int main() {
  int result;
  int food_time;
  for (int i = 0; i < 5; i++) {
    cin >> food_time;
    result += i != 4 ? (int)ceil((float)food_time / 10) * 10 : food_time;
  }
  cout << result << endl;
}
