#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> A(5);
  for (int i = 0; i < 5; i++) {
    cin >> A[i];
    A[i] = (10 - A[i] / 10) * -1;
    sort(A.begin(), A.end());
    reverse(A.begin(), A.end());
  }
  int count = 0;
  for (int i = 0; i < 5; i++) {
    count += A[i];
  }
  cout << count << endl;
}
