#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <utility>
#define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i<i##_end_;i++)
#define IFOR(i, begin, end) for(int i=(end)-1,i##_begin_=(begin);i>=i##_begin_;i--)
#define rep(i, n) FOR(i,0,n)
#define irep(i, n) IFOR(i,0,n)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
using ll = long long;

using namespace std;

int main() {
    char s, t;
    cin >> s;
    cin >> t;
    if (s == 'Y') {
        cout << (char)toupper(t) << endl;
    }
    else {
        cout << t << endl;
    }

    return 0;
}
#include<iostream>
#include<cstring>
#include<cstdio>
#include<climits>
#include<algorithm>
#include<queue>
#include<vector>
#define pii pair<int,int>
#define mp make_pair
#define pb push_back
#define fi first
#define se second
using namespace std;
inline int read(){
	int f=1,ans=0; char c=getchar();
	while(c<'0'||c>'9'){if(c=='-')f=-1;c=getchar();}
	while(c>='0'&&c<='9'){ans=ans*10+c-'0';c=getchar();}
	return f*ans;
}
const int MAXN=1e5+11;
int f[MAXN],N,Ma[28]; char S[MAXN];
int main(){
	//freopen("10.in","r",stdin);
	N=read();
	scanf("%s",S+1);
	memset(Ma,127/3,sizeof(Ma)); memset(f,127/3,sizeof(f));
	Ma[S[1]-'a']=0;
	for(int i=1;i<=N;i++){
		for(int j=0;j<27;j++) if(j!=S[i]-'a') f[i]=min(f[i],Ma[j]+1);
		Ma[S[i+1]-'a']=min(Ma[S[i+1]-'a'],f[i]);
	}
	if(f[N]<=N) printf("%d\n",f[N]); else printf("-1\n");
	return 0;
}