L = input() M = input() N = input() M += N/25 M %= 25 L += M/4 M %= 4 L %= 10 print L+M+N