A,B=gets.split.map(&:to_i) a=(A%12)*60*60+B*60 b=B*60*12 warn [a,b].inspect if a