#include<bits/stdc++.h>
using namespace std;
int dp[50005],n,x,high[50005],ans=-0x3f;
int main(){
while(cin>>x){
high[++n]=x;
}
n--;
memset(dp,1,sizeof(dp));
for(int i=1;i<=n;i++){
for(int j=1;j<=i;j++){
if(high[i]<=high[j]){
dp[i]=max(dp[i],dp[j]+1);
}
ans=max(ans,dp[i]);
}
}
cout<<ans;
}