#include <bits/stdc++.h>
using namespace std;
int main(){
    int max = 30 * 1200;
    int p = 30;
    int c = 1200;
    int s;
    int n;
    cin>>n;
    int price = p;
    while(c > 0){
        p++;
        c -= n;
        s = p * c;
        if(s > max){
            max = s;
            price = p;
        }
    }
    cout<<price<<" "<<max<<endl;
} 
/**************************************************************
	Problem: 1355
	User: wangyiyang
	Language: C++
	Result: Accepted
	Time:13 ms
	Memory:2072 kb
****************************************************************/