$/=words;say ($0*60-$1*11)%720*60/11+|0