#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int a[5];
  int sum = 0;
  for (int i = 0; i < 5; i++) {
    cin >> a[i];
    a[i] = (a[i] % 10 == 0) ? a[i] : (a[i] / 10 + 10);
    sum += a[i];
  }
  cout << sum << endl;
  return 0;
}
