#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,h,m;	
	cin>>n;
	h=n*24;
	m=h*60;
	cout<<h<<endl;
	cout<<m;	
} 
/**************************************************************
	Problem: 1600
	User: sucongyi
	Language: C++
	Result: Accepted
	Time:7 ms
	Memory:2072 kb
****************************************************************/