#include <cstdio> #include <cmath> #include <cstring> #include <ctime> #include <iostream> #include <algorithm> #include <set> #include <vector> #include <sstream> #include <queue> #include <typeinfo> #include <fstream> #include <map> typedef long long ll; using namespace std; //freopen("D.in","r",stdin); //freopen("D.out","w",stdout); #define sspeed ios_base::sync_with_stdio(0);cin.tie(0) #define maxn 10001 #define mod 10007 #define eps 1e-9 //const int inf=0x7fffffff; //无限大 const int inf=0x3f3f3f3f; /* */ //************************************************************************************** inline ll read() { int x=0,f=1;char ch=getchar(); while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();} while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();} return x*f; } int flag[40]; int main() { int n; n=read(); string s; cin>>s; int ans=0; for(int i=0;i<s.size();i++) { //cout<<i<<endl; if(i%2==0) flag[s[i]-'a']++; else { if(flag[s[i]-'A']==0) ans++; else flag[s[i]-'A']--; } } cout<<ans<<endl; }
第七题
最新推荐文章于 2019-03-06 21:11:30 发布