#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> range;
  for (int i = 0; i < 5; i++) {
    int a;
    cin >> a;
    range.push_back(a);
  }
  int min = *std::min_element(range.begin(), range.end());
  int max = *std::max_element(range.begin(), range.end());
  int num = 0;
  if (range[0] % 10 == 0) {
    num = range[0] / 10;
  } else {
    num = range[0] / 10;
    num = num * 10 + 1;
  }
  int t = 0;
  for (int i = 0; i < 5; i++) {
    int num = 0;
    if (range[i] % 10 == 0) {
      num = range[i];
    } else if (range[i] > 10 && range[i] < 20) {
      num = range[i] % 10;
      num = range[i] + num;
    } else if (range[i] > 20 && range[i] < 30) {
      num = range[i] % 10;
      num = range[i] + num;
    } else if (range[i] > 30 && range[i] < 40) {
      num = range[i] % 10;
      num = range[i] + num;
    } else if (range[i] > 40 && range[i] < 50) {
      num = range[i] % 10;
      num = range[i] + num;
    } else if (range[i] > 50 && range[i] < 60) {
      num = range[i] % 10;
      num = range[i] + num;
    } else if (range[i] > 60 && range[i] < 70) {
      num = range[i] % 10;
      num = range[i] + num;
    } else if (range[i] > 70 && range[i] < 80) {
      num = range[i] % 10;
      num = range[i] + num;
    } else if (range[i] > 80 && range[i] < 90) {
      num = range[i] % 10;
      num = range[i] + num;
    } else if (range[i] > 90 && range[i] < 100) {
      num = range[i] % 10;
      num = range[i] + num;
    } else if (range[i] > 100 && range[i] < 110) {
      num = range[i] % 10;
      num = range[i] + num;
    } else if (range[i] > 110 && range[i] < 120) {
      num = range[i] % 10;
      num = range[i] + num;
    } else if (range[i] > 120) {
      num = 130;
    }
  }
  cout << num << "\n";
  return 0;
}
