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