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