#include <fstream>
#include <iostream>

int main() {

	//std::ifstream inf("Text.txt");	std::cin.rdbuf(inf.rdbuf());

	int a;
	std::cin >> a;
	int b = a / 100;
	int c = (a - (b * 100)) * 60 / 100;

	if (10 + b > 24) {
		std::cout << 10 + b - 24 << ":";
	}
	else {
		std::cout << 10 + b << ":";
	}

	if (c < 10) {
		std::cout << "0" << c << std::endl;
	}
	else {
		std::cout << c << std::endl;
	}

	return 0;
}