#!/usr/bin/env python3 #fileencoding: utf-8 L = int(input()) M = int(input()) N = int(input()) M, L = M+L//25, L-L//25*25 N, M = N+M//4, M-M//4*4 N -= N//10 * 10 print(L+M+N)