-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path525A.cpp
53 lines (52 loc) · 1.27 KB
/
525A.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// Jai shree ram
//Author - Ajaybansal
#include <bits/stdc++.h>
using namespace std;
#define vi vector<int>
#define vvi vector<vector<int>>
#define pi pair<int, int>
#define ppb pop_back
#define pf push_front
#define ppf pop_front
#define all(x) (x.begin(). x.end())
//#define for(i, n) for(int i = 0; i < n; i++)
#define endl "\n"
#define ff first
#define ss second
#define Yes cout << "YES" << endl
#define No cout << "NO" << endl
#define int long long
void fast()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
}
signed solve()
{
fast();
int t,ans=0;
cin >> t;
string s;
cin>>s;
unordered_map<char,int> m;
for(int i=0;i<s.size();i++){
if(islower(s[i])){
m[s[i]]++;
}
else if(isupper(s[i])){
if(m[tolower(s[i])]>0){
m[tolower(s[i])]--;
}
else {
ans++;
}
}
}
cout<<ans<<endl;
return 0;
}
signed main()
{
solve();
}