import java.util.Scanner; class Main{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(), b = sc.nextInt(),c = sc.nextInt(); if(c >= 25) { b += c / 25; c = c % 25; } if(b >= 4) { a += b / 4; b = b % 4; } a = a % 10; System.out.println(a + b + c); } }