#include <iostream>
using namespace std;

int main() {
    int n;
    cin >> n;
    int hours = n * 24;
    int minutes = hours * 60;
    cout << hours << endl;
    cout << minutes << endl;
    return 0;
}    
/**************************************************************
	Problem: 1600
	User: fuyijun
	Language: C++
	Result: Accepted
	Time:6 ms
	Memory:2072 kb
****************************************************************/