import java.util.*; class No32{ public static void main(String args[]){ Scanner sc = new Scanner(System.in); int m[] = {1000, 100, 25, 1}; int L = m[1]*(sc.nextInt()); int M = m[2]*(sc.nextInt()); int N = m[3]*(sc.nextInt()); int sum = L + M + N; int coin = 0; for (int i=0; i<=3; i++){ if (i > 0 ){ coin = coin + (sum/m[i]); } sum = (sum - m[i]*(sum/m[i])); } System.out.println(coin); } }