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