#include <bits/stdc++.h>
using namespace std;
int main() {
  int time[5];
  int ans = 0;
  for (int i = 0; i < 5; i++) {
    cin >> time[i];
    ans += time[i];
    ans = (ans + 9) / 10 * 10;
  }
  cout << ans << endl;
}
