#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, count = 0, modmin = 9;
  bool flag = false;
  for (int i = 0; i < 5; i++) {
    if (a % 10 > 0) {
      flag = true;
      modmin = min(modmin, a % 10);
      count += ((int)(a / 10)) * 10 + 10;
    } else {
      count += a;
    }
  }
  if (flag) {
    cout << count - 10 + modmin << endl;
  } else {
    cout << count << endl;
  }
  return 0;
}
