#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b,c;
cin>>a>>b;
c=ceil(1.0*a/b)+10;
cout<<c<<endl;
if(c<=480){
if((480-c)%60>=10)
cout<<'0'<<(480-c)/60<<':'<<(480-c)%60;
else cout<<'0'<<(480-c)/60<<':'<<'0'<<(480-c)%60;
}
else if(c>=1320){
if((1920-c)%60>=10)
cout<<'0'<<(1920-c)/60<<':'<<(1920-c)%60;
else cout<<'0'<<(1920-c)/60<<':'<<'0'<<(1920-c)%60;
}
else {
if((1920-c)%60>=10)
cout<<(1920-c)/60<<':'<<(1920-c)%60;
else cout<<(1920-c)/60<<':'<<'0'<<(1920-c)%60;
}
}