#include<bits/stdc++.h>
using namespace std;
const int N = 1e5+5;
int a[N],dp[N];
int main()
{
ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
int i=1,j,k;
while(cin>>j)
{
a[i]=j;
dp[i ++]=1;
}
--i;
for(j=i-1;j>=1;--j)
{
int mxn=0;
for(k=j+1;k<=i;++k)
{
if(a[k]<a[j])
{
mxn=max(mxn,dp[k]);
}
}
dp[j]=mxn+1;
}
cout<<*max_element(dp+1,dp+i+1)<<'\n';
int ans=1;
for(j=2;j<=i;++j)
{
if(a[j]>a[j-1])
{
ans++;
}
}
cout<<ans;
return 0;
}