#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,x,f;
	cin>>n;
	x=n*24;
	f=x*60;
	cout<<x<<endl;
	printf("%d",f);
}
/**************************************************************
	Problem: 1600
	User: tonghuatao
	Language: C++
	Result: Accepted
	Time:9 ms
	Memory:2072 kb
****************************************************************/