#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int ans, A[5];
  cin >> A[0];
  ans += A[0];
  for (int i = 1; i < 5; i++) {
    cin >> A[i];
    A[i] += 10 - (A[i] % 10);
    ans += A[i];
  }
  cout << ans << endl;
}
