#include <bits/stdc++.h>
using namespace std;
int main() {
  int A;
  int B;
  int C;
  int D;
  int E;
  cin >> A;
  cin >> B;
  cin >> C;
  cin >> D;
  cin >> E;
  int num;
  if (A % 10 == 0) {
    num = A + B;
  } else {
    num = (A / 10 + 1) * 10 + B;
  }
  if (num % 10 == 0) {
    num = num + C;
  } else {
    num = (num / 10 + 1) * 10 + C;
  }
  if (num % 10 == 0) {
    num = num + D;
  } else {
    num = (num / 10 + 1) * 10 + D;
  }
  if (num % 10 == 0) {
    num = num + E;
  } else {
    num = (num / 10 + 1) * 10 + E;
  }
  cout << num << endl;
}
