#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, d, e;
  int result;
  cin >> a;
  cin >> b;
  cin >> c;
  cin >> d;
  cin >> e;
  result = a / 10 + 1;
  result = result + b / 10 + 1;
  result = result + c / 10 + 1;
  result = result + d / 10 + 1;
  result = result * 10;
  result = result + e;
  cout << result;
}
