#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, d, e;
  cin >> a >> b >> c >> d >> e;
  if (a % 10 != 0) {
    while (a % 10 == 0) {
      a++;
    }
  }
  if (b % 10 == 0) {
    while (b % 10 != 0) {
      b++;
    }
  }
  if (c % 10 == 0) {
    while (c % 10 != 0) {
      c++;
    }
  }
  if (d % 10 == 0) {
    while (d % 10 != 0) {
      d++;
    }
  }
  if (e % 10 == 0) {
    while (e % 10 != 0) {
      e++;
    }
  }
  cout << a + b + c + d + e << endl;
}
