#include <iostream>
using namespace std;

int main() {
  int a[];
  for (int i=0; i<5; ++i) cin >> a[i];
  int total = 0;
  for (int j=0; j<5; ++j) {
    if (a[j]%==0){ total += a[j]}
    else { total += a[j] + 10-a[l]%10}
  }
  cout >> total;
  return 0;
}