#include <bits/stdc++.h>
using namespace std;
int main() {
  int N[5];
  int total_minute = 0;
  for (int i = 0; i < 5; i++) {
    int minute;
    cin >> minute;
    total_minute += ceil(minute / 10.0) * 10;
  }
  cout << total_minute;
}
