#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,day=0,ans=0;
cin>>n;
vector<int> a(n);
for (int i=0;i<a.size();i++)
{
a[i]=i+1;
}
while(a.size()>0)
{
day++;
vector<int> b;
for (int i=0;i<a.size();i++)
{
if (i%3==0)
{
if (a[i]==n)
{
ans=day;
}
}
else
{
b.push_back(a[i]);
}
}
a=b;
}
cout<<day<<" "<<ans;
return 0;
}