#include <stdio.h> int main(){ int a,b; scanf("%d %d",&a,&b); int t=(60*(a/100)+a%100); int m=t+b; int n=(m/60)*100+m%60; printf("%d",n); return 0; }