# -*- coding: utf-8 -*- L = int(input()) M = int(input()) N = int(input()) L, M = L % 25, M+L // 25 M, N = M % 4, N+M // 4 N %= 10 print(L + M + N)