module main; import std; void main() { auto L = readln.chomp.to!int; auto M = readln.chomp.to!int; auto N = readln.chomp.to!int; M += N / 25; N %= 25; L += M / 4; M %= 4; L %= 10; writeln(L + M + N); }