#include <bits/stdc++.h>
using namespace std;
int s, v, t, h = 7, m = 60;
void read() {
scanf("%d%d",&s,&v);
}
void compute() {
t = ceil((double)s / v) ;
t = 470 - t;
if (t > 0) {
h -= ceil(t / 60) - 1;
m -= t % 60;
}
m -= t;
}
void print() {
if (h < 10) {
printf("0%d:%d",h,m) ;
} else {
printf("%d:%d",h,m);
}
}
int main() {
read();
compute();
print();
return 0;
}