#include <bits/stdc++.h>
int main(void) {
  int dish[5], i, j, k, min = 650, sum = 0;
  for (i = 0; i < 5; i++) {
    sum = 0;
    sum += dish[i];
    while (sum % 10 != 0) {
      sum++;
    }
    for (j = 0; j < 5; j++) {
      if (i != j) {
        sum += dish[j];
        if (j != 4) {
          while (sum % 10 != 0) {
            sum++;
          }
        }
      }
    }
    if (sum < min) {
      min = sum;
    }
  }
  printf("%d", sum);
  return 0;
}
