#include <bits/stdc++.h>
using namespace std;
int ncr(int n, int r) {
  int res = 1;
  if (r > n - r) r = n - r;
  for (int i = 0; i < r; i++) {
    res *= n - i;
    res /= i + 1;
  }
  return res;
}
int gcd(int a, int b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  int sum = 0;
  while (t--) {
    int arr[5];
    int a, b, c, d, e;
    cin >> a >> b >> c >> d >> e;
    arr[0] = a;
    arr[1] = b;
    arr[2] = c;
    arr[3] = e;
    arr[4] = d;
    for (int i = 0; i < 5; i++) {
      if (sum % 10 != 0) {
        int n = sum / 10;
        sum = (n + 1) * 10;
      }
      sum += arr[i];
    }
  }
  cout << sum;
}
