var hour,min,sec:longint;
begin
readln(hour,min,sec); //hour - часы, min - минуты, sec - секунды.
writeln(min+hour*60+round(sec/60));
end.
var hour,min,sec:longint;
begin
readln(hour,min,sec); //hour - часы, min - минуты, sec - секунды.
writeln(min+hour*60+round(sec/60));
end.