#!/usr/bin/env python3 #fileencoding: utf-8 N = int(input()) M = int(input()) L = 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)