stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include <iostream>

#include <bits/stdc++.h>

using namespace std;

int b[100006] ={0};

int main()

{

    int n,a[100006],mx=0,cnt=0,sum=0,k=0,no=0;

    cin>>n;

    memset(b,0,sizeof(b));

    for(int i=0;i<n;i++){

        scanf("%d",&a[i]);

    }



    for(int i=1;i<n;i++){

        if(a[i-1]>=a[i]){

            no=b[k];

            no++;

            b[k]=no;

        }else{

            k++;

            no=0;

           

        }

    }

    for(int j=0;j<=k;j++){

        if(mx<b[j]){

            mx=b[j];

        }

    }

    cout<<mx<<endl;

   





    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.4098017959859215x):


#include <iostream>

#include <algorithm>



using namespace std;



int main(){

    int N; cin >> N; int H[N], barrier[N] = {}, MAX = 0;

    for (int i = 0  ; i <  N; i++){

        cin >> H[i];

        if (i > 0) {

            if (H[i] <=  H[i-1]) barrier[i] = barrier[i-1]+1,

                 MAX = max( MAX, barrier[i] )  ;

            else                 barrier[i] = 0;

        }

    } cout << MAX << endl;



    return 0;

}
// Slower C++ solution:
#include <iostream>

#include <bits/stdc++.h>

using namespace std;

int b[100006] ={0};

int main()

{

    int n,a[100006],mx=0,cnt=0,sum=0,k=0,no=0;

    cin>>n;

    memset(b,0,sizeof(b));

    for(int i=0;i<n;i++){

        scanf("%d",&a[i]);

    }



    for(int i=1;i<n;i++){

        if(a[i-1]>=a[i]){

            no=b[k];

            no++;

            b[k]=no;

        }else{

            k++;

            no=0;

           

        }

    }

    for(int j=0;j<=k;j++){

        if(mx<b[j]){

            mx=b[j];

        }

    }

    cout<<mx<<endl;

   





    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.4117827346883713x):
#include<bits/stdc++.h>

#include<climits>

using namespace std;

int main()

{

     long long int n,i,flag=0;

    cin>>n;

   long long int ar[n];

    for(i=0;i<n;i++)

        cin>>ar[i];

        long long int mi=0;

    for(i=0;i<n-1;i++)

    {

        if(ar[i]>=ar[i+1])

            {

            flag++;

            }

        else if(ar[i]<ar[i+1])

        {

            flag=0;

        }

        if(mi<flag)

        {

            mi=flag;

        }

    }

    cout<<mi<<endl;

}
// Slower C++ solution:
#include <iostream>

#include <bits/stdc++.h>

using namespace std;

int b[100006] ={0};

int main()

{

    int n,a[100006],mx=0,cnt=0,sum=0,k=0,no=0;

    cin>>n;

    memset(b,0,sizeof(b));

    for(int i=0;i<n;i++){

        scanf("%d",&a[i]);

    }



    for(int i=1;i<n;i++){

        if(a[i-1]>=a[i]){

            no=b[k];

            no++;

            b[k]=no;

        }else{

            k++;

            no=0;

           

        }

    }

    for(int j=0;j<=k;j++){

        if(mx<b[j]){

            mx=b[j];

        }

    }

    cout<<mx<<endl;

   





    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.4118024015809658x):
    #include<bits/stdc++.h>

    #include<climits>

    using namespace std;

    int main()

    {

         long long int n,i,flag=0;

        cin>>n;

       long long int ar[n];

        for(i=0;i<n;i++)

            cin>>ar[i];

        if(n==1)

            cout<<"0"<<endl;

        else{

            long long int mi=INT_MIN;

        for(i=0;i<n-1;i++)

        {

            if(ar[i]>=ar[i+1])

                {

                flag++;

                }

            else if(ar[i]<ar[i+1])

            {

                flag=0;

            }

            if(mi<flag)

            {

                mi=flag;

            }

        }

        cout<<mi<<endl;

        }

    }
// Slower C++ solution:
#include <iostream>

#include <bits/stdc++.h>

using namespace std;

int b[100006] ={0};

int main()

{

    int n,a[100006],mx=0,cnt=0,sum=0,k=0,no=0;

    cin>>n;

    memset(b,0,sizeof(b));

    for(int i=0;i<n;i++){

        scanf("%d",&a[i]);

    }



    for(int i=1;i<n;i++){

        if(a[i-1]>=a[i]){

            no=b[k];

            no++;

            b[k]=no;

        }else{

            k++;

            no=0;

           

        }

    }

    for(int j=0;j<=k;j++){

        if(mx<b[j]){

            mx=b[j];

        }

    }

    cout<<mx<<endl;

   





    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.4110476025548442x):
#include<bits/stdc++.h>

#include<algorithm>

using namespace std;

int main() {

	int a,p,ma=0,cnt=0,last;

	cin>>a;

	for(int i=0;i<a;i++){

		cin>>p;

		if(last>=p && i!=0) cnt++;

		if(last<p && i!=0)

		{

			ma=max(cnt,ma);

			cnt=0;

		}

		last=p;

	}

	cout<<max(cnt,ma)<<endl;

	return 0;

}
// Slower C++ solution:
#include <iostream>

#include <bits/stdc++.h>

using namespace std;

int b[100006] ={0};

int main()

{

    int n,a[100006],mx=0,cnt=0,sum=0,k=0,no=0;

    cin>>n;

    memset(b,0,sizeof(b));

    for(int i=0;i<n;i++){

        scanf("%d",&a[i]);

    }



    for(int i=1;i<n;i++){

        if(a[i-1]>=a[i]){

            no=b[k];

            no++;

            b[k]=no;

        }else{

            k++;

            no=0;

           

        }

    }

    for(int j=0;j<=k;j++){

        if(mx<b[j]){

            mx=b[j];

        }

    }

    cout<<mx<<endl;

   





    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.3948333478839907x):
#include<bits/stdc++.h>

using namespace std;

#define ll long long

ll ar[1000005];

int main()

{

    ios_base::sync_with_stdio(false);

    cin.tie(NULL);

    ll n;

    while(cin>>n)

    {

    ll cnt=0,mx=0;

    for(ll i=0;i<n;i++)

    {

       cin>>ar[i];

    }

    for(ll i=1;i<n;i++)

    {

        if(ar[i]<=ar[i-1])

            cnt++;

        else

        {

            if(cnt>mx)

                mx=cnt;

            cnt=0;



        }

    }

    if(cnt!=0)

    {

        if(cnt>mx)

            mx=cnt;

    }

    cout<<mx<<endl;

    }

    return 0;

}
// Slower C++ solution:
#include <iostream>

#include <bits/stdc++.h>

using namespace std;

int b[100006] ={0};

int main()

{

    int n,a[100006],mx=0,cnt=0,sum=0,k=0,no=0;

    cin>>n;

    memset(b,0,sizeof(b));

    for(int i=0;i<n;i++){

        scanf("%d",&a[i]);

    }



    for(int i=1;i<n;i++){

        if(a[i-1]>=a[i]){

            no=b[k];

            no++;

            b[k]=no;

        }else{

            k++;

            no=0;

           

        }

    }

    for(int j=0;j<=k;j++){

        if(mx<b[j]){

            mx=b[j];

        }

    }

    cout<<mx<<endl;

   





    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.4076892113936001x):
#include<bits/stdc++.h>

using namespace std;

int main()

{

	vector<int>v;

	long long int n,h,i,cnt=0,x=0;

	cin>>n;

	for(i=0;i<n;i++)

	{

		cin>>h;

		v.push_back(h);

	}

	for(i=1;i<v.size();i++)

	{

		if(v[i]<=v[i-1])

		{

			cnt++;

			if(cnt>x)

			{

				x=cnt;

			}

		}

		else

		{

			cnt=0;

		}

	}



	cout<<x<<endl;

}
// Slower C++ solution:
#include <iostream>

#include <bits/stdc++.h>

using namespace std;

int b[100006] ={0};

int main()

{

    int n,a[100006],mx=0,cnt=0,sum=0,k=0,no=0;

    cin>>n;

    memset(b,0,sizeof(b));

    for(int i=0;i<n;i++){

        scanf("%d",&a[i]);

    }



    for(int i=1;i<n;i++){

        if(a[i-1]>=a[i]){

            no=b[k];

            no++;

            b[k]=no;

        }else{

            k++;

            no=0;

           

        }

    }

    for(int j=0;j<=k;j++){

        if(mx<b[j]){

            mx=b[j];

        }

    }

    cout<<mx<<endl;

   





    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.392987789635497x):
#include<bits/stdc++.h>

#define fastio ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);

#define range(i,l,h) for(int i=l;i<h;i++)

#define endl '\n'

#define I INT_MAX

#define L INT_MIN

#define all(c) (c).begin(), (c).end()

#define pb push_back

#define ll long long

#define ull unsigned long long

#define vi vector<int>

using namespace std;

using std::ios;

constexpr int MOD=1e9+7;

constexpr int mod=998244353;

const int mxn=100005;



int main()

{

  fastio;

  

  

  int n;

  cin>>n;

  vi a(n);

  int l=0,ans=0,last=0;

  range(i,0,n)

  {

    cin>>a[i];

    if(i==0)

    {

      last=a[i];

      continue;

    }

    if(a[i]>a[i-1])

    {

      ans=max(ans,l);

      l=0;

      last=a[i];

    }

    else l++;

  }

   ans=max(ans,l);

      l=0;

  cout<<ans;



}
// Slower C++ solution:
#include <iostream>

#include <bits/stdc++.h>

using namespace std;

int b[100006] ={0};

int main()

{

    int n,a[100006],mx=0,cnt=0,sum=0,k=0,no=0;

    cin>>n;

    memset(b,0,sizeof(b));

    for(int i=0;i<n;i++){

        scanf("%d",&a[i]);

    }



    for(int i=1;i<n;i++){

        if(a[i-1]>=a[i]){

            no=b[k];

            no++;

            b[k]=no;

        }else{

            k++;

            no=0;

           

        }

    }

    for(int j=0;j<=k;j++){

        if(mx<b[j]){

            mx=b[j];

        }

    }

    cout<<mx<<endl;

   





    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.383098589273108x):
#include<bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>

#include <ext/pb_ds/tree_policy.hpp>

#include <functional>

 

using namespace std;

using namespace __gnu_pbds;

 

typedef long long ll;

#define int long long int

typedef complex<long double> cd;

const long double pi=acos(-1);

typedef double db;

typedef long double ldb;

typedef pair <int,int> pii;

typedef pair <db,db> pdd;

typedef vector<int> vi;

typedef vector<vector<int> > matrix;

 

#define m1 make_pair

#define pb push_back

#define flush fflush(stdout)

#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);

#define reset(x,v) memset(x,v,sizeof(x))

 

#define fi first

#define se second

#define endl "\n"

#define debug(x) (cerr << #x << ": " << x << "\n")

#define setbits(x) __builtin_popcount(x)

#define setbitsll(x) __builtin_popcountll(x)

#define all(x) x.begin(),x.end()

#define pii pair<int,int>

 

inline int gcd(int a,int b){if(a==0) return b;return gcd(b%a,a);}

inline int power(ll a,ll n,ll m){if(n==0)return 1;ll p=power(a,n/2,m);p=(p%m*p%m)%m;if(n%2) return (p%m*a%m)%m;else return p;}

const double EPS = 1e-9;

const ll MOD=998244353;

const ll hell=1000000007;

const int INF = 1e18;

const ll LL_INF = 0x3f3f3f3f3f3f3f3f;

template<typename T>

using ordered_set=tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;

 

auto seed = chrono::high_resolution_clock::now().time_since_epoch().count();

std::mt19937 rng(seed);

 

double startTime;

double getCurrentTime() {

    return ((double)clock() - startTime) / CLOCKS_PER_SEC;

}

const int dx[] = { -1, 0, 1, 0 };

const int dy[] = { 0, 1, 0, -1 };

 

const int N=200005;





void solve()

{

int n;

cin>>n;

int h[n+1];

for(int i=1;i<=n;i++)

cin>>h[i];

h[0]= -INF;

int ans=1;

int k=0;

for(int i=1;i<=n;i++)

{

    if(h[i]>h[i-1])

    {

      ans=max(ans,k+1);

      k=0;

    }

    else

    {

        k++;

    }   

}

ans=max(ans,k+1);

cout<<ans-1<<endl;





}

 

int32_t main()

{

    IOS;

    int t;

    t=1;

    //cin>>t;

    while(t--)

    {

        

        solve();

    }

    return 0;

}
// Slower C++ solution:
#include<iostream>

#include<algorithm>

#include<cmath>

#include<iomanip>

#include<map>

using namespace std;

int main() {

  long long n,a[100000]={},ans=0,cnt=0;

  cin >> n;

  for(int i=0; i<n; i++) {

    cin >> a[i];

  }

  for(int i=0; i<n-1; i++) {

    if(a[i+1]<=a[i]) {

      cnt++;

      ans=max(ans,cnt);

    }

    else {

      cnt=0;

    }

  }

  cout << ans << endl;

}


// Faster C++ solution for the same problem (measured speedup: 1.2846840278431477x):
//   _/                _/                 _/_/_/   _/

//_/_/_/_/   _/_/   _/_/_/_/   _/_/    _/       _/_/

// _/     _/    _/   _/     _/    _/  _/_/_/     _/

//_/     _/    _/   _/     _/    _/  _/    _/   _/

// _/_/   _/_/       _/_/   _/_/      _/_/     _/

#include<iostream>

#include<algorithm>

#include<cmath>

#include<iomanip>

#include<set>

#include<map>

#include<queue>

#include<vector>

using namespace std;

typedef long long ll;

const int MOD=1e9+7;

const double pi=3.14159265358979323846;

const int inf=2e9;

const ll INF=9e18;

typedef pair<int,int> P;

int main() {

  cin.tie(0),cout.tie(0);

  ios::sync_with_stdio(false);

  int n,h[100005]={},cnt=0,ans=0;

  cin >> n;

  for(int i=0; i<n; i++) {

    cin >> h[i];

  }

  for(int i=0; i<n-1; i++) {

    if(h[i]>=h[i+1]) {

      cnt++;

      ans=max(ans,cnt);

    }

    else {

      cnt=0;

    }

  }

  cout << ans << endl;

}
// Slower C++ solution:
#include <algorithm>

#include <iostream>

#include <vector>



using namespace std;



int main(void) {

  int N;

  cin >> N;

  vector<int> H(N);

  for (auto& v : H) {

    cin >> v;

  }



  int ans = 0;

  int cnt = 0;

  for (int i = 0; i < N - 1; ++i) {

    if (H[i] >= H[i + 1]) {

      cnt++;

      ans = max(ans, cnt);

    } else {

      cnt = 0;

    }

  }

  cout << ans << endl;

}


// Faster C++ solution for the same problem (measured speedup: 5.241232083261143x):
#include <stdio.h>



int H[100000];



int main(void) {

  int N;

  scanf("%d", &N);

  for (int i = 0; i < N;++i) {

    scanf("%d", H + i);

  }



  int ans = 0;

  int cnt = 0;

  for (int i = 0; i < N - 1; ++i) {

    if (H[i] >= H[i + 1]) {

      cnt++;

      if (ans < cnt)

        ans = cnt;

    } else {

      cnt = 0;

    }

  }

  printf("%d\n",ans);

}
// Slower C++ solution:
#include <iostream>

//#include <string>

using namespace std;

int n;

int h[100010];



int max(int *num) {

	int res = 0;

	for (int i = 0; i < n; i++) {

		if (res < num[i]) {

			res = num[i];

		}

	}

	return res;

}



int main() {

	int count[100010] = { 0 };

	cin >> n;

	for (int i = 0; i < n; i++) {

		cin >> h[i];

	}

	h[n] = 2000000000;

	int j=0;

	int k = 0;

	for (int i = 0; i < n - 1; i++) {

		j = i;

		k = i;

		while (h[j] >= h[j + 1]) {

			j++;

			count[i]++;

		}

		if (count[i] != 0) {

			while (count[k] != 0) {

				k++;

				count[k] = count[k - 1] - 1;

			}

			i = k;

		}

	}

	cout << max(count) << endl;

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.4042108422267567x):
#include <iostream>

#include <string>

#include <vector>

#include <stack>

#include <queue>



#include <stdio.h>

#include <math.h>

#include <stdlib.h>



using namespace std;



inline int max(int a, int b) {//最大

	if (a > b) return a;

	return b;

}



int n, h[100005],ans=0,max1=0;

int main() {

	cin >> n;

	for (int i = 0; i < n; i++) {

		cin >> h[i];

	}

	for (int i = 0; i < n; i++) {

		while (h[i]>=h[i+1] && i<n-1) {

			max1++;

			

			i++;

		}

		ans=max(max1, ans);

		max1 = 0;

	}

	cout << ans << endl;

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

const int inf=1e5+5;

typedef long long ll;

int n,m;

bool vis[100005];

vector<int> v[100005];

int main()

{

    cin>>n;

    int a[n+1];

    for(int i=0;i<n;i++) cin>>a[i];

    int ans=0;

    int k=0;

    for(int i=1;i<n;i++){

        if(a[i]>a[i-1]){

           k=i;

        }

        ans=max(ans,i-k);

    }

    cout<<ans;

}


// Faster C++ solution for the same problem (measured speedup: 3.4845237329974523x):
#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>

#include <ext/pb_ds/tree_policy.hpp>

#define leading zero str.erase(0, min(str.find_first_not_of('0'), str.size()-1));

using namespace __gnu_pbds;

using namespace std;

typedef long long ll;

typedef pair<int, int> pii;

typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

string text="abcdefghijklmnopqrstuvwxyz";

const int maxn=1e6+7;

//        .--------------.

//        | Try First One|

//        '--------------'

//                |     .--------------.

//                |     |              |

//                V     V              |

//              .--------------.       |

//              |      AC.     |<---.  |

//              '--------------'    |  |

//              (True)|  |(False)   |  |

//           .--------'  |          |  |

//           |           V          |  |

//           |  .--------------.    |  |

//           |  |   Try Again  |----'  |

//           |  '--------------'       |

//           |                         |

//           |  .--------------.       |

//           '->| Try Next One |-------'

//              '--------------'

int main()

{

    ios_base::sync_with_stdio(false);

    cin.tie(NULL);

    ll n;

    cin>>n;

    ll a[n+2];

    for(int i=0;i<n;i++)cin>>a[i];

    ll cnt=1;

    ll mx=-1;

    for(int i=1;i<n;i++){

        if(a[i]<=a[i-1])cnt++;

        else{

            mx=max(mx,cnt);

            cnt=1;

        }

    }

    mx=max(mx,cnt);

    if(mx==-1)cout<<0<<endl;

    else cout<<mx-1<<endl;

}
// Slower C++ solution:
#include <iostream>

#include <string>

#include <vector>

#include <set>

#include <algorithm>

using namespace std;



int main() {

  int n;

  string s;

  cin >> n >> s;

  int ans = 0;

  for (int i = 0; i < n; ++i) {

    set<char> x, y;

    for (int j = 0; j <= i; ++j) {

      x.insert(s[j]);

    }

    for (int j = i+1; j < n; ++j) {

      y.insert(s[j]);

    }

    vector<char> v(n);

    auto it = set_intersection(x.begin(), x.end(), y.begin(), y.end(), v.begin());

    v.resize(it-v.begin());

    // cout << v.size() << endl;

    // for (auto it : v) {

    //   cout << it <<  ' ';

    // } cout << endl;

    ans = max(ans, (int)v.size());

  }

  cout << ans << endl;

}


// Faster C++ solution for the same problem (measured speedup: 1.0600327319638219x):
#include <iostream>

#include <cstdio>

#include <cstring>

#include <cstdlib>

#define N 110

using namespace std;



char s[N],ss[N];



int main()

{

	char c;

	int j,k,temp,n,i,ans,flag;

	

	while (scanf("%d",&n)!=EOF)

	{

		c=getchar();

		fgets(s,sizeof(s),stdin);

		s[n]='\0';

		ans=0;

		

		for (i=1;i<n;i++)

		{

			strcpy(ss,s);

			temp=0;

			

			for (j=0;j<i&&j<n;j++)

			{

				flag=1;

				

				for (k=i;k<n;k++)

				{

					if (ss[k]==s[j])

					{

						if (flag)

						{

							flag=0;

							temp++;

						}

						

						ss[k]='#';

					}

				}

			}

			

			ans=max(ans,temp);

		}

		

		printf("%d\n",ans);

	}

	

	return 0;

 }
// Slower C++ solution:
#include <iostream>

#include <string>

#include <vector>

#include <set>

#include <algorithm>

using namespace std;



int main() {

  int n;

  string s;

  cin >> n >> s;

  int ans = 0;

  for (int i = 0; i < n; ++i) {

    set<char> x, y;

    for (int j = 0; j <= i; ++j) {

      x.insert(s[j]);

    }

    for (int j = i+1; j < n; ++j) {

      y.insert(s[j]);

    }

    vector<char> v(n);

    auto it = set_intersection(x.begin(), x.end(), y.begin(), y.end(), v.begin());

    v.resize(it-v.begin());

    // cout << v.size() << endl;

    // for (auto it : v) {

    //   cout << it <<  ' ';

    // } cout << endl;

    ans = max(ans, (int)v.size());

  }

  cout << ans << endl;

}


// Faster C++ solution for the same problem (measured speedup: 5.56640365520935x):
#include<cstdio>

#include<algorithm>

using namespace std;

const int MAXN = 100;

char s[MAXN + 5];

int cnt1[26], cnt2[26];

int main() {

	int N;

	scanf("%d%s", &N, s);

	for(int i=0;i<N;i++)

		cnt1[s[i]-'a']++;

	int ans = 0, res = 0;

	for(int i=0;i<N-1;i++) {

		cnt2[s[i]-'a']++;

		if( cnt2[s[i]-'a'] == 1 ) ans++;

		if( cnt2[s[i]-'a'] == cnt1[s[i]-'a'] ) ans--;

		res = max(res, ans);

	}

	printf("%d\n", res);

}
// Slower C++ solution:
#include <iostream>

#include <cstdio>

#include <cstring>

#include <cstdlib>

#define N 110

using namespace std;



char s[N],ss[N];



int main()

{

	char c;

	int j,k,temp,n,i,ans,flag;

	

	while (scanf("%d",&n)!=EOF)

	{

		c=getchar();

		fgets(s,sizeof(s),stdin);

		s[n]='\0';

		ans=0;

		

		for (i=1;i<n;i++)

		{

			strcpy(ss,s);

			temp=0;

			

			for (j=0;j<i&&j<n;j++)

			{

				flag=1;

				

				for (k=i;k<n;k++)

				{

					if (ss[k]==s[j])

					{

						if (flag)

						{

							flag=0;

							temp++;

						}

						

						ss[k]='#';

					}

				}

			}

			

			ans=max(ans,temp);

		}

		

		printf("%d\n",ans);

	}

	

	return 0;

 } 

// Faster C++ solution for the same problem (measured speedup: 5.2511620512859105x):
#include<cstdio>

#include<algorithm>

using namespace std;

const int MAXN = 100;

char s[MAXN + 5];

int cnt1[26], cnt2[26];

int main() {

	int N;

	scanf("%d%s", &N, s);

	for(int i=0;i<N;i++)

		cnt1[s[i]-'a']++;

	int ans = 0, res = 0;

	for(int i=0;i<N-1;i++) {

		cnt2[s[i]-'a']++;

		if( cnt2[s[i]-'a'] == 1 ) ans++;

		if( cnt2[s[i]-'a'] == cnt1[s[i]-'a'] ) ans--;

		res = max(res, ans);

	}

	printf("%d\n", res);

}
// Slower C++ solution:
#include<iostream>

#include<string>

#include<set>

#include<queue>

#include<algorithm>

using namespace std;

int vis[200];

int main(){

	int t;

	string a;

	cin>>t;

	cin>>a;

	set<char> left;

	set<char> right;

	set<char> final;

	queue<char> q;

	queue<char> p;

	int n=a.length();

	for(int i=0;i<n;i++){

		q.push(a[i]);



	}



	for(int i=0;i<n-1;i++){

		left.insert(a[i]);

		q.pop();

		p=q;

		right.clear();

		while(!p.empty()){

			right.insert(p.front());

			p.pop();

		}

		

		set<char>::iterator it1;

		set<char>::iterator it2;

		for(it1=left.begin();it1!=left.end();it1++){

			final.insert(*it1);

		}

		for(it2=right.begin();it2!=right.end();it2++){

			final.insert(*it2);

		}

		int an=left.size()+right.size()-final.size();

		vis[i]=an;

	

	}

	sort(vis,vis+n-1);

	cout<<vis[n-2]<<endl;



	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.533396008956029x):
#include<cstdio>

#include<algorithm>

using namespace std;

const int MAXN = 100;

char s[MAXN + 5];

int cnt1[26], cnt2[26];

int main() {

	int N;

	scanf("%d%s", &N, s);

	for(int i=0;i<N;i++)

		cnt1[s[i]-'a']++;

	int ans = 0, res = 0;

	for(int i=0;i<N-1;i++) {

		cnt2[s[i]-'a']++;

		if( cnt2[s[i]-'a'] == 1 ) ans++;

		if( cnt2[s[i]-'a'] == cnt1[s[i]-'a'] ) ans--;

		res = max(res, ans);

	}

	printf("%d\n", res);

}
// Slower C++ solution:
#include <iostream>

#include <string>

#include <vector>

#include <set>

#include <algorithm>

using namespace std;



int main() {

  int n;

  string s;

  cin >> n >> s;

  int ans = 0;

  for (int i = 0; i < n; ++i) {

    set<char> x, y;

    for (int j = 0; j <= i; ++j) {

      x.insert(s[j]);

    }

    for (int j = i+1; j < n; ++j) {

      y.insert(s[j]);

    }

    vector<char> v(n);

    auto it = set_intersection(x.begin(), x.end(), y.begin(), y.end(), v.begin());

    v.resize(it-v.begin());

    // cout << v.size() << endl;

    // for (auto it : v) {

    //   cout << it <<  ' ';

    // } cout << endl;

    ans = max(ans, (int)v.size());

  }

  cout << ans << endl;

}


// Faster C++ solution for the same problem (measured speedup: 1.053815813580801x):
#include<iostream>

#include <stdio.h>

#include <cmath>

#include <string>

#define N 105

using namespace std;

int flag[N],key[N],dancing[N];

int main (){

    int a,x,ans,ma;string str("");

    while (cin>>a){

        ans=0;ma=0;

        for (int i=0;i<26;i++){

            flag[i]=0;

            key[i]=0;

            dancing[i]=0;

        }

        cin>>str;

        for (int i=0;i<a;i++){

            char x=str.at(i);

            flag[((int)x)-97]++;

            dancing[((int)x)-97]++;

        }

        for (int i=0;i<a;i++){

            char x=str.at(i);

            if (dancing[((int)x)-97]>=2){

                flag[((int)x)-97]--;

                if (flag[((int)x)-97]>0&&key[((int)x-97)]==0){

                    ma++;

                    key[((int)x)-97]++;

                }

                if (flag[((int)x)-97]==0){

                    ma--;

                }

                if (ans<ma){

                    ans=ma;

                }

            }

        }

        cout<<ans<<endl;

    }

    return 0;

}