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