#include <iostream>
#include <iomanip>
using namespace std;
int main() {
int s, v;
cin >> s >> v;
int time_to_school = s / v + (s % v ? 1 : 0);
int latest_time = 480 - time_to_school - 10;
int hours = latest_time / 60;
int minutes = latest_time % 60;
cout << setfill('0') << setw(2) << hours << ":" << setw(2) << minutes << endl;
return 0;
}