#include <bits/stdc++.h>
using namespace std;
int main() {
int n,q;
cin>>n>>q;
string s;
cin>>s;
pair<int, int> ans={0,0};
for (int i=0; i<n;i++){
if (s[i]=='0'){
ans.first++;
int j=i;
while (s[j]=='0') j++;
i=j-1;
}
else{
ans.second++;
int j=i;
while (s[j]=='1') j++;
i=j-1;
}
}
cout<<min(ans.first,ans.second)<<endl;
for (int i=0; i<q;i++){
int z;
cin>>z;
z--;
if (s[z]=='0'){
s[z]='1';
if (z==0){
if (s[1]=='1'){
ans.first--;
cout<<min(ans.first,ans.second)<<endl;
}
else{
ans.second++;
cout<<min(ans.first,ans.second)<<endl;
}
}
else{
if (z==n-1){
if (s[z-1]=='1'){
ans.first--;
cout<<min(ans.first,ans.second)<<endl;
}
else{
ans.second++;
cout<<min(ans.first,ans.second)<<endl;
}
}
else{
if (s[z-1]=='1'){
if (s[z+1]=='1'){
ans.first--;
ans.second--;
cout<<min(ans.first,ans.second)<<endl;
}
else{
cout<<min(ans.first,ans.second)<<endl;
}
}
else{
if (s[z+1]=='1'){
cout<<min(ans.first,ans.second)<<endl;
}
else{
ans.first++;
ans.second++;
cout<<min(ans.first,ans.second)<<endl;
}
}
}
}
}
else{
s[z]='0';
if (z==0){
if (s[1]=='0'){
ans.second--;
cout<<min(ans.first,ans.second)<<endl;
}
else{
ans.first++;
cout<<min(ans.first,ans.second)<<endl;
}
}
else{
if (z==n-1){
if (s[z-1]=='1'){
ans.first++;
cout<<min(ans.first,ans.second)<<endl;
}
else{
ans.second--;
cout<<min(ans.first, ans.second)<<endl;
}
}
else{
if (s[z-1]=='1'){
if (s[z+1]=='1'){
ans.second++;
ans.first++;
cout<<min(ans.first,ans.second)<<endl;
}
else{
cout<<min(ans.first,ans.second)<<endl;
}
}
else{
if (s[z+1]=='1') cout<<min(ans.first,ans.second)<<endl;
else{
ans.first--;
ans.second--;
cout<<min(ans.first,ans.second)<<endl;
}
}
}
}
}
}
}