import java.io.*;
import java.util.*;
import java.math.*;

public class C {
    public static void main(String args[]) {
        try {
            InputReader in = new InputReader(System.in);
            BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));
            int n = in.readInt();
            int m = in.readInt();
            char[] s = in.readLine().toCharArray();
            Vector<Segment> seg = new Vector<>();
            Vector<Integer> segstart = new Vector<>();
            long initans = 0l;
            for (int i = 0; i < n; i++) {
                if(s[i] == '.'){
                    int j = i;
                    while(j < n && s[j] == '.'){
                        j++;
                    }
                    j--;
                    seg.add(new Segment(i, j));
                    segstart.add(i);
                    initans += (long)(j - i);
                    i = j;
                }
            }
            for (int i = 0; i < m; i++) {
                int ind = in.readInt() - 1;
                char c = in.readCharacter();
                segstart = new Vector<>();
                for(Segment sg: seg){
                    segstart.add(sg.l);
                }
                if(c == '.'){
                    int bs = Collections.binarySearch(segstart, ind);
                    if(bs < 0)
                        bs = -1 -bs;
                    boolean found = false;
                    if(bs - 1 >= 0 && bs < seg.size()){
                        Segment fr = seg.get(bs - 1);
                        Segment sc = seg.get(bs);
                        if(fr.r == ind - 1 && sc.l == ind + 1){
                            seg.add(new Segment(fr.l, sc.r));
                            seg.remove(bs);
                            seg.remove(bs - 1);
                            initans -= (fr.r - fr.l);
                            initans -= (sc.r - sc.l);
                            initans += (sc.r - fr.l);
                            found = true;
                        }
                    }
                    if(!found && bs - 1 >= 0){
                        Segment sc = seg.get(bs - 1);
                        if(sc.r + 1 == ind){
                            found = true;
                            seg.add(new Segment(sc.l, ind));
                            initans -= (sc.r - sc.l);
                            initans += (ind - sc.l);
                            seg.remove(bs - 1);
                        }
                        else if(sc.l - 1 == ind){
                            found = true;
                            seg.add(new Segment(ind, sc.r));
                            seg.remove(bs - 1);
                            initans -= (sc.r - sc.l);
                            initans += (sc.r - ind);
                        }
                    }
                    if(!found && bs < seg.size()){
                        Segment sc = seg.get(bs);
                        if(sc.r + 1 == ind){
                            seg.add(new Segment(sc.l, ind));
                            initans -= (sc.r - sc.l);
                            seg.remove(bs - 1);
                            initans += (ind - sc.l);
                        }
                        else if(sc.l - 1 == ind){
                            seg.add(new Segment(ind, sc.r));
                            seg.remove(bs);
                            initans -= (sc.r - sc.l);
                            initans += (sc.r - ind);
                        }
                    }
                }
                else{
                    int bs = Collections.binarySearch(segstart, ind);
                    if(bs < 0)
                        bs = -1 -bs;
                    boolean found = false;
                    if(bs - 1 >= 0 && bs - 1 < seg.size()){
                        Segment sc = seg.get(bs - 1);
                        if(ind >= sc.l && ind <= sc.r){
                            if(ind - 1 >= sc.l){
                                seg.add(new Segment(sc.l, ind - 1));
                                initans += (ind - 1 - sc.l);
                            }
                            if(ind + 1 <= sc.r){
                                seg.add(new Segment(ind + 1, sc.r));
                                initans += (sc.r - ind - 1);
                            }
                            seg.remove(bs - 1);
                            initans -= (sc.r - sc.l);
                            found = true;
                        }
                    }

                    if(!found && bs < seg.size()){
                        Segment sc = seg.get(bs);
                        if(ind >= sc.l && ind <= sc.r){
                            if(ind - 1 >= sc.l){
                                seg.add(new Segment(sc.l, ind - 1));
                                initans += (ind - 1 - sc.l);
                            }
                            if(ind + 1 <= sc.r){
                                seg.add(new Segment(ind + 1, sc.r));
                                initans += (sc.r - ind - 1);
                            }
                            seg.remove(bs);
                            initans -= (sc.r - sc.l);
                        }
                    }
                }
                out.write(Long.toString(initans));
                out.newLine();
                Collections.sort(segstart);
                Collections.sort(seg);
            }
            out.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
class Segment implements Comparable<Segment>{
    int l, r;
    public Segment(int l, int r) {
        this.l = l;
        this.r = r;
    }
    public int compareTo(Segment that){
        return Integer.compare(this.l, that.l);
    }
    public String toString(){
        return this.l+" "+this.r;
    }
}
class InputReader {
    private boolean finished = false;

    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (numChars == -1)
            throw new InputMismatchException();
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    public int peek() {
        if (numChars == -1)
            return -1;
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                return -1;
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar];
    }

    public int readInt() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public long readLong() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public String readString() {
        int length = readInt();
        if (length < 0)
            return null;
        byte[] bytes = new byte[length];
        for (int i = 0; i < length; i++)
            bytes[i] = (byte) read();
        try {
            return new String(bytes, "UTF-8");
        } catch (UnsupportedEncodingException e) {
            return new String(bytes);
        }
    }

    public static boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    private String readLine0() {
        StringBuffer buf = new StringBuffer();
        int c = read();
        while (c != '\n' && c != -1) {
            if (c != '\r')
                buf.appendCodePoint(c);
            c = read();
        }
        return buf.toString();
    }

    public String readLine() {
        String s = readLine0();
        while (s.trim().length() == 0)
            s = readLine0();
        return s;
    }

    public String readLine(boolean ignoreEmptyLines) {
        if (ignoreEmptyLines)
            return readLine();
        else
            return readLine0();
    }

    public BigInteger readBigInteger() {
        try {
            return new BigInteger(readString());
        } catch (NumberFormatException e) {
            throw new InputMismatchException();
        }
    }

    public char readCharacter() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        return (char) c;
    }

    public double readDouble() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        double res = 0;
        while (!isSpaceChar(c) && c != '.') {
            if (c == 'e' || c == 'E')
                return res * Math.pow(10, readInt());
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        }
        if (c == '.') {
            c = read();
            double m = 1;
            while (!isSpaceChar(c)) {
                if (c == 'e' || c == 'E')
                    return res * Math.pow(10, readInt());
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                m /= 10;
                res += (c - '0') * m;
                c = read();
            }
        }
        return res * sgn;
    }

    public boolean isExhausted() {
        int value;
        while (isSpaceChar(value = peek()) && value != -1)
            read();
        return value == -1;
    }

    public String next() {
        return readString();
    }

    public boolean readBoolean() {
        return readInt() == 1;
    }
}


import java.io.*;
import java.util.*;
import java.math.*;

public class C {
    public static void main(String args[]) {
        try {
            InputReader in = new InputReader(System.in);
            BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));
            int n = in.readInt();
            int m = in.readInt();
            char[] s = in.readLine().toCharArray();
            Vector<Segment> seg = new Vector<>();
            Vector<Integer> segstart = new Vector<>();
            long initans = 0l;
            for (int i = 0; i < n; i++) {
                if(s[i] == '.'){
                    int j = i;
                    while(j < n && s[j] == '.'){
                        j++;
                    }
                    j--;
                    seg.add(new Segment(i, j));
                    segstart.add(i);
                    initans += (long)(j - i);
                    i = j;
                }
            }
            for (int i = 0; i < m; i++) {
                int ind = in.readInt() - 1;
                char c = in.readCharacter();
                segstart = new Vector<>();
                for(Segment sg: seg){
                    segstart.add(sg.l);
                }
                if(c == '.'){
                    int bs = Collections.binarySearch(segstart, ind);
                    if(bs < 0)
                        bs = -1 -bs;
                    boolean found = false;
                    if(bs - 1 >= 0 && bs < seg.size()){
                        Segment fr = seg.get(bs - 1);
                        Segment sc = seg.get(bs);
                        if(fr.r == ind - 1 && sc.l == ind + 1){
                            seg.add(new Segment(fr.l, sc.r));
                            seg.remove(bs);
                            seg.remove(bs - 1);
                            initans -= (fr.r - fr.l);
                            initans -= (sc.r - sc.l);
                            initans += (sc.r - fr.l);
                            found = true;
                        }
                    }
                    if(!found && bs - 1 >= 0){
                        Segment sc = seg.get(bs - 1);
                        if(sc.r + 1 == ind){
                            found = true;
                            seg.add(new Segment(sc.l, ind));
                            initans -= (sc.r - sc.l);
                            initans += (ind - sc.l);
                            seg.remove(bs - 1);
                        }
                        else if(sc.l - 1 == ind){
                            found = true;
                            seg.add(new Segment(ind, sc.r));
                            seg.remove(bs - 1);
                            initans -= (sc.r - sc.l);
                            initans += (sc.r - ind);
                        }
                    }
                    if(!found && bs < seg.size()){
                        Segment sc = seg.get(bs);
                        if(sc.r + 1 == ind){
                            seg.add(new Segment(sc.l, ind));
                            initans -= (sc.r - sc.l);
                            seg.remove(bs);
                            initans += (ind - sc.l);
                        }
                        else if(sc.l - 1 == ind){
                            seg.add(new Segment(ind, sc.r));
                            seg.remove(bs);
                            initans -= (sc.r - sc.l);
                            initans += (sc.r - ind);
                        }
                    }
                    if(!found && s[ind] != '.'){
                        seg.add(new Segment(ind, ind));
                    }
                }
                else{
                    int bs = Collections.binarySearch(segstart, ind);
                    if(bs < 0)
                        bs = -1 -bs;
                    boolean found = false;
                    if(bs - 1 >= 0 && bs - 1 < seg.size()){
                        Segment sc = seg.get(bs - 1);
                        if(ind >= sc.l && ind <= sc.r){
                            if(ind - 1 >= sc.l){
                                seg.add(new Segment(sc.l, ind - 1));
                                initans += (ind - 1 - sc.l);
                            }
                            if(ind + 1 <= sc.r){
                                seg.add(new Segment(ind + 1, sc.r));
                                initans += (sc.r - ind - 1);
                            }
                            seg.remove(bs - 1);
                            initans -= (sc.r - sc.l);
                            found = true;
                        }
                    }
                    if(!found && bs < seg.size()){
                        Segment sc = seg.get(bs);
                        if(ind >= sc.l && ind <= sc.r){
                            if(ind - 1 >= sc.l){
                                seg.add(new Segment(sc.l, ind - 1));
                                initans += (ind - 1 - sc.l);
                            }
                            if(ind + 1 <= sc.r){
                                seg.add(new Segment(ind + 1, sc.r));
                                initans += (sc.r - ind - 1);
                            }
                            seg.remove(bs);
                            initans -= (sc.r - sc.l);
                        }
                    }
                }
                out.write(Long.toString(initans));
                out.newLine();
                s[ind] = c;
                Collections.sort(segstart);
                Collections.sort(seg);
            }
            out.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
class Segment implements Comparable<Segment>{
    int l, r;
    public Segment(int l, int r) {
        this.l = l;
        this.r = r;
    }
    public int compareTo(Segment that){
        return Integer.compare(this.l, that.l);
    }
    public String toString(){
        return this.l+" "+this.r;
    }
}
class InputReader {
    private boolean finished = false;

    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (numChars == -1)
            throw new InputMismatchException();
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    public int peek() {
        if (numChars == -1)
            return -1;
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                return -1;
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar];
    }

    public int readInt() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public long readLong() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public String readString() {
        int length = readInt();
        if (length < 0)
            return null;
        byte[] bytes = new byte[length];
        for (int i = 0; i < length; i++)
            bytes[i] = (byte) read();
        try {
            return new String(bytes, "UTF-8");
        } catch (UnsupportedEncodingException e) {
            return new String(bytes);
        }
    }

    public static boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    private String readLine0() {
        StringBuffer buf = new StringBuffer();
        int c = read();
        while (c != '\n' && c != -1) {
            if (c != '\r')
                buf.appendCodePoint(c);
            c = read();
        }
        return buf.toString();
    }

    public String readLine() {
        String s = readLine0();
        while (s.trim().length() == 0)
            s = readLine0();
        return s;
    }

    public String readLine(boolean ignoreEmptyLines) {
        if (ignoreEmptyLines)
            return readLine();
        else
            return readLine0();
    }

    public BigInteger readBigInteger() {
        try {
            return new BigInteger(readString());
        } catch (NumberFormatException e) {
            throw new InputMismatchException();
        }
    }

    public char readCharacter() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        return (char) c;
    }

    public double readDouble() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        double res = 0;
        while (!isSpaceChar(c) && c != '.') {
            if (c == 'e' || c == 'E')
                return res * Math.pow(10, readInt());
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        }
        if (c == '.') {
            c = read();
            double m = 1;
            while (!isSpaceChar(c)) {
                if (c == 'e' || c == 'E')
                    return res * Math.pow(10, readInt());
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                m /= 10;
                res += (c - '0') * m;
                c = read();
            }
        }
        return res * sgn;
    }

    public boolean isExhausted() {
        int value;
        while (isSpaceChar(value = peek()) && value != -1)
            read();
        return value == -1;
    }

    public String next() {
        return readString();
    }

    public boolean readBoolean() {
        return readInt() == 1;
    }
}


import java.io.*;
import java.util.*;
import java.math.*;

public class C {
    public static void main(String args[]) {
        try {
            InputReader in = new InputReader(System.in);
            BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));
            int n = in.readInt();
            int m = in.readInt();
            char[] s = in.readLine().toCharArray();
            Vector<Segment> seg = new Vector<>();
            Vector<Integer> segstart = new Vector<>();
            long initans = 0l;
            for (int i = 0; i < n; i++) {
                if(s[i] == '.'){
                    int j = i;
                    while(j < n && s[j] == '.'){
                        j++;
                    }
                    j--;
                    seg.add(new Segment(i, j));
                    segstart.add(i);
                    initans += (long)(j - i);
                    i = j;
                }
            }
            for (int i = 0; i < m; i++) {
                int ind = in.readInt() - 1;
                char c = in.readCharacter();
                segstart = new Vector<>();
                for(Segment sg: seg){
                    segstart.add(sg.l);
                }
                if(c == '.'){
                    int bs = Collections.binarySearch(segstart, ind);
                    if(bs < 0)
                        bs = -1 -bs;
                    boolean found = false;
                    if(bs - 1 >= 0 && bs < seg.size()){
                        Segment fr = seg.get(bs - 1);
                        Segment sc = seg.get(bs);
                        if(fr.r == ind - 1 && sc.l == ind + 1){
                            seg.add(new Segment(fr.l, sc.r));
                            seg.remove(bs);
                            seg.remove(bs - 1);
                            initans -= (fr.r - fr.l);
                            initans -= (sc.r - sc.l);
                            initans += (sc.r - fr.l);
                            found = true;
                        }
                    }
                    if(!found && bs - 1 >= 0){
                        Segment sc = seg.get(bs - 1);
                        if(sc.r + 1 == ind){
                            found = true;
                            seg.add(new Segment(sc.l, ind));
                            initans -= (sc.r - sc.l);
                            initans += (ind - sc.l);
                            seg.remove(bs - 1);
                        }
                        else if(sc.l - 1 == ind){
                            found = true;
                            seg.add(new Segment(ind, sc.r));
                            seg.remove(bs - 1);
                            initans -= (sc.r - sc.l);
                            initans += (sc.r - ind);
                        }
                    }
                    if(!found && bs < seg.size()){
                        Segment sc = seg.get(bs);
                        if(sc.r + 1 == ind){
                            seg.add(new Segment(sc.l, ind));
                            initans -= (sc.r - sc.l);
                            seg.remove(bs);
                            initans += (ind - sc.l);
                        }
                        else if(sc.l - 1 == ind){
                            seg.add(new Segment(ind, sc.r));
                            seg.remove(bs);
                            initans -= (sc.r - sc.l);
                            initans += (sc.r - ind);
                        }
                    }
                }
                else{
                    int bs = Collections.binarySearch(segstart, ind);
                    if(bs < 0)
                        bs = -1 -bs;
                    boolean found = false;
                    if(bs - 1 >= 0 && bs - 1 < seg.size()){
                        Segment sc = seg.get(bs - 1);
                        if(ind >= sc.l && ind <= sc.r){
                            if(ind - 1 >= sc.l){
                                seg.add(new Segment(sc.l, ind - 1));
                                initans += (ind - 1 - sc.l);
                            }
                            if(ind + 1 <= sc.r){
                                seg.add(new Segment(ind + 1, sc.r));
                                initans += (sc.r - ind - 1);
                            }
                            seg.remove(bs - 1);
                            initans -= (sc.r - sc.l);
                            found = true;
                        }
                    }

                    if(!found && bs < seg.size()){
                        Segment sc = seg.get(bs);
                        if(ind >= sc.l && ind <= sc.r){
                            if(ind - 1 >= sc.l){
                                seg.add(new Segment(sc.l, ind - 1));
                                initans += (ind - 1 - sc.l);
                            }
                            if(ind + 1 <= sc.r){
                                seg.add(new Segment(ind + 1, sc.r));
                                initans += (sc.r - ind - 1);
                            }
                            seg.remove(bs);
                            initans -= (sc.r - sc.l);
                        }
                    }
                }
                out.write(Long.toString(initans));
                out.newLine();
                Collections.sort(segstart);
                Collections.sort(seg);
            }
            out.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
class Segment implements Comparable<Segment>{
    int l, r;
    public Segment(int l, int r) {
        this.l = l;
        this.r = r;
    }
    public int compareTo(Segment that){
        return Integer.compare(this.l, that.l);
    }
    public String toString(){
        return this.l+" "+this.r;
    }
}
class InputReader {
    private boolean finished = false;

    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (numChars == -1)
            throw new InputMismatchException();
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    public int peek() {
        if (numChars == -1)
            return -1;
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                return -1;
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar];
    }

    public int readInt() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public long readLong() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public String readString() {
        int length = readInt();
        if (length < 0)
            return null;
        byte[] bytes = new byte[length];
        for (int i = 0; i < length; i++)
            bytes[i] = (byte) read();
        try {
            return new String(bytes, "UTF-8");
        } catch (UnsupportedEncodingException e) {
            return new String(bytes);
        }
    }

    public static boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    private String readLine0() {
        StringBuffer buf = new StringBuffer();
        int c = read();
        while (c != '\n' && c != -1) {
            if (c != '\r')
                buf.appendCodePoint(c);
            c = read();
        }
        return buf.toString();
    }

    public String readLine() {
        String s = readLine0();
        while (s.trim().length() == 0)
            s = readLine0();
        return s;
    }

    public String readLine(boolean ignoreEmptyLines) {
        if (ignoreEmptyLines)
            return readLine();
        else
            return readLine0();
    }

    public BigInteger readBigInteger() {
        try {
            return new BigInteger(readString());
        } catch (NumberFormatException e) {
            throw new InputMismatchException();
        }
    }

    public char readCharacter() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        return (char) c;
    }

    public double readDouble() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        double res = 0;
        while (!isSpaceChar(c) && c != '.') {
            if (c == 'e' || c == 'E')
                return res * Math.pow(10, readInt());
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        }
        if (c == '.') {
            c = read();
            double m = 1;
            while (!isSpaceChar(c)) {
                if (c == 'e' || c == 'E')
                    return res * Math.pow(10, readInt());
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                m /= 10;
                res += (c - '0') * m;
                c = read();
            }
        }
        return res * sgn;
    }

    public boolean isExhausted() {
        int value;
        while (isSpaceChar(value = peek()) && value != -1)
            read();
        return value == -1;
    }

    public String next() {
        return readString();
    }

    public boolean readBoolean() {
        return readInt() == 1;
    }
}


import java.io.BufferedReader;
import java.io.InputStreamReader;

public class C {
	public static void main(String args[])throws Exception {
		BufferedReader input = new BufferedReader(
				new InputStreamReader(System.in));
		String[] tokens = input.readLine().split(" ");
		String findStr = "..";
		int n = Integer.parseInt(tokens[0]);
		int m = Integer.parseInt(tokens[1]);

		String line = input.readLine();
		StringBuilder s = new StringBuilder(line);

		int lastIndex = 0;
		int count = 0;

		while(lastIndex != -1){

		    lastIndex = s.indexOf(findStr,lastIndex);

		    if(lastIndex != -1){
		        count ++;
		        lastIndex++;
		    }
		}

		while(m > 0) {

			tokens = input.readLine().split(" ");
			int x = Integer.parseInt(tokens[0]) -1;
			char c = tokens[1].charAt(0);

			if(c=='.') {
				if(x+1 < n && s.charAt(x+1)=='.' && s.charAt(x)!='.') {
					count++;
				}
				if(x-1 >=0 && s.charAt(x-1)=='.' && s.charAt(x)!='.') {
					count++;
				}
			} else {
				if(x+1 < n && s.charAt(x+1)=='.' && s.charAt(x)=='.') {
					count--;
				}
				if(x-1 >=0 && s.charAt(x-1)=='.' && s.charAt(x)=='.') {
					count --;
				}
			}
			s.replace(x, x+1, String.valueOf(c));

			System.out.println(count);
			m--;
		}
	}
}


import java.io.BufferedReader;
import java.io.InputStreamReader;

public class C {
	public static void main(String args[])throws Exception {
		BufferedReader input = new BufferedReader(
				new InputStreamReader(System.in));
		String[] tokens = input.readLine().split(" ");
		String findStr = "..";
		int n = Integer.parseInt(tokens[0]);
		int m = Integer.parseInt(tokens[1]);

		String line = input.readLine();
		StringBuilder s = new StringBuilder(line);
		while(m > 0) {

			tokens = input.readLine().split(" ");
			int x = Integer.parseInt(tokens[0]);
			char c = tokens[1].charAt(0);

			s.replace(x-1, x, String.valueOf(c));

			int lastIndex = 0;
			int count = 0;

			while(lastIndex != -1){

			    lastIndex = s.indexOf(findStr,lastIndex);

			    if(lastIndex != -1){
			        count ++;
			        lastIndex++;
			    }
			}
			System.out.println(count);
			m--;
		}
	}
}


import java.io.BufferedReader;
import java.io.InputStreamReader;

public class C {
	public static void main(String args[])throws Exception {
		BufferedReader input = new BufferedReader(
				new InputStreamReader(System.in));
		String[] tokens = input.readLine().split(" ");
		String findStr = "..";
		int n = Integer.parseInt(tokens[0]);
		int m = Integer.parseInt(tokens[1]);

		String line = input.readLine();
		char[] s = line.toCharArray();
		int count = 0;

		for(int i=0;i<n-1;i++)
			if(s[i]=='.' && s[i+1]=='.')
				count++;

		while(m > 0) {

			tokens = input.readLine().split(" ");
			int x = Integer.parseInt(tokens[0]) -1;
			char c = tokens[1].charAt(0);

			if(c=='.') {
				if(x+1 < n && s[x+1]=='.' && s[x]!='.') {
					count++;
				}
				if(x-1 >=0 && s[x-1]=='.' && s[x]!='.') {
					count++;
				}
			} else {
				if(x+1 < n && s[x+1]=='.' && s[x]=='.') {
					count--;
				}
				if(x-1 >=0 && s[x-1]=='.' && s[x]=='.') {
					count --;
				}
			}
			s[x] = c;

			System.out.println(count);
			m--;
		}
	}
}


import java.io.BufferedReader;
import java.io.InputStreamReader;

public class C {
	public static void main(String args[])throws Exception {
		BufferedReader input = new BufferedReader(
				new InputStreamReader(System.in));
		String[] tokens = input.readLine().split(" ");
		String findStr = "..";
		int n = Integer.parseInt(tokens[0]);
		int m = Integer.parseInt(tokens[1]);

		String line = input.readLine();
		StringBuilder s = new StringBuilder(line);
		int count = 0;

		for(int i=0;i<n-1;i++)
			if(line.charAt(i)=='.' && line.charAt(i+1)=='.')
				count++;

		while(m > 0) {

			tokens = input.readLine().split(" ");
			int x = Integer.parseInt(tokens[0]) -1;
			char c = tokens[1].charAt(0);

			if(c=='.') {
				if(x+1 < n && s.charAt(x+1)=='.' && s.charAt(x)!='.') {
					count++;
				}
				if(x-1 >=0 && s.charAt(x-1)=='.' && s.charAt(x)!='.') {
					count++;
				}
			} else {
				if(x+1 < n && s.charAt(x+1)=='.' && s.charAt(x)=='.') {
					count--;
				}
				if(x-1 >=0 && s.charAt(x-1)=='.' && s.charAt(x)=='.') {
					count --;
				}
			}
			s.replace(x, x+1, String.valueOf(c));

			System.out.println(count);
			m--;
		}
	}
}


import java.util.Scanner;
import java.util.StringTokenizer;
import java.io.PrintWriter;

public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		StringTokenizer st = new StringTokenizer(sc.nextLine());
			int len = Integer.parseInt(st.nextToken()),n = Integer.parseInt(st.nextToken());
			String str = sc.nextLine();
			char arr[] = str.toCharArray();
			int ans =0;
			for(int i=0;i<len-1;i++)
				if(arr[i]=='.' && arr[i+1]=='.')
					ans++;
			for(int s=0;s< n;s++){
				st = new StringTokenizer(sc.nextLine());
				int pos = Integer.parseInt(st.nextToken())-1;
				char temp =  st.nextToken().charAt(0);
				char in = arr[pos];
				if(in!=temp)
				{
					if(in=='.')
					{
						if(pos>0 && arr[pos-1]=='.')
							ans--;
						if(pos<len-1 && arr[pos+1]=='.')
							ans--;
					}
					else if(temp=='.')
					{
						if(pos>0 && arr[pos-1]=='.')
							ans++;
						if(pos<len-1 && arr[pos+1]=='.')
							ans++;
					}
				}
				arr[pos] = temp;
				out.println(ans);
			}
		out.flush();
	}
}


import java.util.Scanner;
import java.util.StringTokenizer;
import java.io.PrintWriter;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Main{
	public static void main(String[] args) throws IOException{
		Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer(br.readLine());
			int len = Integer.parseInt(st.nextToken()),n = Integer.parseInt(st.nextToken());
			String str = br.readLine();
			char arr[] = str.toCharArray();
			int ans =0;
			for(int i=0;i<len-1;i++)
				if(arr[i]=='.' && arr[i+1]=='.')
					ans++;
			for(int s=0;s< n;s++){
				st = new StringTokenizer(br.readLine());
				int pos = Integer.parseInt(st.nextToken())-1;
				char temp =  st.nextToken().charAt(0);
				char in = arr[pos];
				if(in!=temp)
				{
					if(in=='.')
					{
						if(pos>0 && arr[pos-1]=='.')
							ans--;
						if(pos<len-1 && arr[pos+1]=='.')
							ans--;
					}
					else if(temp=='.')
					{
						if(pos>0 && arr[pos-1]=='.')
							ans++;
						if(pos<len-1 && arr[pos+1]=='.')
							ans++;
					}
				}
				arr[pos] = temp;
				out.println(ans);
			}
		out.flush();
	}
}


import java.io.*;
import java.util.*;
import java.awt.*;

public class Main {
    public static void main(String[] args) throws Exception {
        FastReader sc = new FastReader();
        StringBuilder sb=new StringBuilder();
        int n=sc.nextInt(),m=sc.nextInt();
        char[] c=sc.next().toCharArray();
        int total=0,seg=0;
        boolean z=false;
        for(int i=0;i<c.length;i++){
            if(c[i]=='.'){
                total++;
                if(!z){
                    z=true;
                    seg++;
                }
            }
            else z=false;
        }
        for(int i=0;i<m;i++){
            int index=sc.nextInt()-1;
            char x=sc.next().charAt(0);
            if(x=='.'){
                if(index==0){
                    c[0]='.';
                    if(c[1]=='.')total++;
                    else{
                        total++;
                        seg++;
                    }
                }
                else if(index==c.length-1){
                    c[index]='.';
                    if(c[index-1]=='.')total++;
                    else{
                        total++;
                        seg++;
                    }
                }
                else{
                    c[index]='.';
                    if(c[index-1]=='.' && c[index+1]=='.') seg--;
                    else if(c[index-1]!='.' && c[index+1]!='.') seg++;
                    total++;
                }
            }
            else{
                c[index]=x;
                total--;
                if(index==0){
                    if(c[index+1]!='.')seg--;
                }
                else if(index==c.length-1){
                    if(c[index-1]!='.')seg--;
                }
                else{
                    if(c[index-1]=='.' && c[index+1]=='.') seg++;
                    else if(c[index-1]!='.' && c[index+1]!='.')seg--;
                }
            }
            sb.append(total-seg+"\n");
        }
        System.out.println(sb);
    }
}
class FastReader {
    BufferedReader br;
    StringTokenizer st;

    public FastReader() {
        br = new BufferedReader(new
                InputStreamReader(System.in));
    }
    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }
    int nextInt() { return Integer.parseInt(next()); }
    long nextLong() { return Long.parseLong(next()); }
    double nextDouble() { return Double.parseDouble(next()); }
    String nextLine() {
        String str = "";
        try {
            str = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return str;
    }
}


import java.io.*;
import java.util.*;
import java.awt.*;

public class Main {
    public static void main(String[] args) throws Exception {
        FastReader sc = new FastReader();
        StringBuilder sb=new StringBuilder();
        int n=sc.nextInt(),m=sc.nextInt();
        char[] c=sc.next().toCharArray();
        int total=0,seg=0;
        boolean z=false;
        for(int i=0;i<c.length;i++){
            if(c[i]=='.'){
                total++;
                if(!z){
                    z=true;
                    seg++;
                }
            }
            else z=false;
        }

        for(int i=0;i<m;i++){
            int index=sc.nextInt()-1;
            char x=sc.next().charAt(0);
            if(c.length==1){
                sb.append(0+"\n");
                continue;
            }
            if(x=='.' && c[index]!='.'){
                if(index==0){
                    c[0]='.';
                    if(c[1]=='.')total++;
                    else{
                        total++;
                        seg++;
                    }
                }
                else if(index==c.length-1){
                    c[index]='.';
                    if(c[index-1]=='.')total++;
                    else{
                        total++;
                        seg++;
                    }
                }
                else{
                    c[index]='.';
                    if(c[index-1]=='.' && c[index+1]=='.') seg--;
                    else if(c[index-1]!='.' && c[index+1]!='.') seg++;
                    total++;
                }
            }
            else if(x!='.' && c[index]=='.'){
                c[index]=x;
                total--;
                if(index==0){
                    if(c[index+1]!='.')seg--;
                }
                else if(index==c.length-1){
                    if(c[index-1]!='.')seg--;
                }
                else{
                    if(c[index-1]=='.' && c[index+1]=='.') seg++;
                    else if(c[index-1]!='.' && c[index+1]!='.')seg--;
                }
            }
            sb.append(total-seg+"\n");
        }
        System.out.println(sb);
    }
}
class FastReader {
    BufferedReader br;
    StringTokenizer st;

    public FastReader() {
        br = new BufferedReader(new
                InputStreamReader(System.in));
    }
    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }
    int nextInt() { return Integer.parseInt(next()); }
    long nextLong() { return Long.parseLong(next()); }
    double nextDouble() { return Double.parseDouble(next()); }
    String nextLine() {
        String str = "";
        try {
            str = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return str;
    }
}


import java.io.*;
import java.util.*;
import java.awt.*;

public class Main {
    public static void main(String[] args) throws Exception {
        FastReader sc = new FastReader();
        StringBuilder sb=new StringBuilder();
        int n=sc.nextInt(),m=sc.nextInt();
        char[] c=sc.next().toCharArray();
        int total=0,seg=0;
        boolean z=false;
        for(int i=0;i<c.length;i++){
            if(c[i]=='.'){
                total++;
                if(!z){
                    z=true;
                    seg++;
                }
            }
            else z=false;
        }

        for(int i=0;i<m;i++){
            int index=sc.nextInt()-1;
            char x=sc.next().charAt(0);
            if(x=='.' && c[index]!='.'){
                if(index==0){
                    c[0]='.';
                    if(c[1]=='.')total++;
                    else{
                        total++;
                        seg++;
                    }
                }
                else if(index==c.length-1){
                    c[index]='.';
                    if(c[index-1]=='.')total++;
                    else{
                        total++;
                        seg++;
                    }
                }
                else{
                    c[index]='.';
                    if(c[index-1]=='.' && c[index+1]=='.') seg--;
                    else if(c[index-1]!='.' && c[index+1]!='.') seg++;
                    total++;
                }
            }
            else if(x!='.' && c[index]=='.'){
                c[index]=x;
                total--;
                if(index==0){
                    if(c[index+1]!='.')seg--;
                }
                else if(index==c.length-1){
                    if(c[index-1]!='.')seg--;
                }
                else{
                    if(c[index-1]=='.' && c[index+1]=='.') seg++;
                    else if(c[index-1]!='.' && c[index+1]!='.')seg--;
                }
            }
            sb.append(total-seg+"\n");
        }
        System.out.println(sb);
    }
}
class FastReader {
    BufferedReader br;
    StringTokenizer st;

    public FastReader() {
        br = new BufferedReader(new
                InputStreamReader(System.in));
    }
    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }
    int nextInt() { return Integer.parseInt(next()); }
    long nextLong() { return Long.parseLong(next()); }
    double nextDouble() { return Double.parseDouble(next()); }
    String nextLine() {
        String str = "";
        try {
            str = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return str;
    }
}


import java.io.*;
import java.util.*;
public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int n=Integer.parseInt(st.nextToken());
        int m=Integer.parseInt(st.nextToken());
        char[] str=br.readLine().toCharArray();
        int i,count=0,begin=0;
        boolean started=false;
        for(i=0;i<n;i++){
            if(!started && str[i]=='.'){
                started=true;
                begin=i;
            }
            else if(started && str[i]!='.'){
                started=false;
                count+=i-begin-1;
            }
            else if(started && i==n-1)
                count+=i-begin;
        }
        //System.out.println(count);
        for(i=0;i<m;i++){
            st=new StringTokenizer(br.readLine());
            int index=Integer.parseInt(st.nextToken())-1;
            char ch=st.nextToken().trim().charAt(0);
            if(ch!='.' && str[index]=='.'){
                if(index==0){
                    if(str[index+1]=='.')
                        count--;
                }
                else if(index==n-1){
                    if(str[index-1]=='.')
                        count--;
                }
                else if(str[index-1]=='.' || str[index+1]=='.'){
                    if(str[index-1]=='.' && str[index+1]=='.')
                        count-=2;
                    else
                        count--;
                }
                str[index]=ch;
            }
            if(ch=='.' && str[index]!='.'){
                if(index==0){
                    if(str[index+1]=='.')
                        count++;
                }
                else if(index==n-1){
                    if(str[index-1]=='.')
                        count++;
                }
                else if(str[index-1]=='.' || str[index+1]=='.'){
                    if(str[index-1]=='.' && str[index+1]=='.')
                        count+=2;
                    else
                        count++;
                }
                str[index]=ch;
            }
            System.out.println(count);
        }
    }
}


import java.io.*;
import java.util.*;
public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int n=Integer.parseInt(st.nextToken());
        int m=Integer.parseInt(st.nextToken());
        char[] str=br.readLine().trim().toCharArray();
        int i,count=0,begin=0;
        boolean started=false;
        for(i=0;i<n;i++){
            if(!started && str[i]=='.'){
                started=true;
                begin=i;
            }
            else if(started && str[i]!='.'){
                started=false;
                count+=i-begin-1;
            }
            else if(started && i==n-1)
                count+=i-begin;
        }
        //System.out.println(count);
        for(i=0;i<m;i++){
            st=new StringTokenizer(br.readLine());
            int index=Integer.parseInt(st.nextToken())-1;
            char ch=st.nextToken().trim().charAt(0);
            if(ch!='.' && str[index]=='.'){
                if(index==0){
                    if(str[index+1]=='.')
                        count--;
                }
                else if(index==n-1){
                    if(str[index-1]=='.')
                        count--;
                }
                else if(str[index-1]=='.' || str[index+1]=='.'){
                    if(str[index-1]=='.' && str[index+1]=='.')
                        count-=2;
                    else
                        count--;
                }
                str[index]=ch;
            }
            if(ch=='.' && str[index]!='.'){
                if(index==0){
                    if(str[index+1]=='.')
                        count++;
                }
                else if(index==n-1){
                    if(str[index-1]=='.')
                        count++;
                }
                else if(str[index-1]=='.' || str[index+1]=='.'){
                    if(str[index-1]=='.' && str[index+1]=='.')
                        count+=2;
                    else
                        count++;
                }
                str[index]=ch;
            }
            System.out.println(count);
        }
    }
}


import java.io.*;
import java.util.*;
public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int n=Integer.parseInt(st.nextToken());
        int m=Integer.parseInt(st.nextToken());
        char[] str=br.readLine().trim().toCharArray();
        int i,count=0,begin=0;
        boolean started=false;
        for(i=0;i<n;i++){
            if(!started && str[i]=='.'){
                started=true;
                begin=i;
            }
            else if(started && str[i]!='.'){
                started=false;
                count+=i-begin-1;
            }
            else if(started && i==n-1)
                count+=i-begin;
        }
        //System.out.println(count);
        for(i=0;i<m;i++){
            st=new StringTokenizer(br.readLine());
            int index=Integer.parseInt(st.nextToken())-1;
            char ch=st.nextToken().trim().charAt(0);
            if(ch!='.' && str[index]=='.'){
                if(index==0 && index+1<n){
                    if(str[index+1]=='.')
                        count--;
                }
                else if(index==n-1 && index-1>=0){
                    if(str[index-1]=='.')
                        count--;
                }
                else if(index-1>=0 && index+1<n && (str[index-1]=='.' || str[index+1]=='.')){
                    if(str[index-1]=='.' && str[index+1]=='.')
                        count-=2;
                    else
                        count--;
                }
                str[index]=ch;
            }
            if(ch=='.' && str[index]!='.'){
                if(index==0 && index+1<n){
                    if(str[index+1]=='.')
                        count++;
                }
                else if(index==n-1 && index-1>=0){
                    if(str[index-1]=='.')
                        count++;
                }
                else if(index-1>=0 && index+1<n && (str[index-1]=='.' || str[index+1]=='.')){
                    if(str[index-1]=='.' && str[index+1]=='.')
                        count+=2;
                    else
                        count++;
                }
                str[index]=ch;
            }
            System.out.println(count);
        }
    }
}


import java.io.*;
import java.util.*;
public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int n=Integer.parseInt(st.nextToken());
        int m=Integer.parseInt(st.nextToken());
        char[] str=br.readLine().trim().toCharArray();
        int i,count=0,begin=0;
        boolean started=false;
        for(i=0;i<n;i++){
            if(!started && str[i]=='.'){
                started=true;
                begin=i;
            }
            else if(started && str[i]!='.'){
                started=false;
                count+=i-begin-1;
            }
            else if(started && i==n-1)
                count+=i-begin;
        }
        //System.out.println(count);
        for(i=0;i<m;i++){
            st=new StringTokenizer(br.readLine());
            int index=Integer.parseInt(st.nextToken())-1;
            char ch=st.nextToken().trim().charAt(0);
            if(ch!='.' && str[index]=='.'){
                if(index==0 && index+1<n){
                    if(str[index+1]=='.')
                        count--;
                }
                else if(index==n-1 && index-1>=0){
                    if(str[index-1]=='.')
                        count--;
                }
                else if(index-1>=0 && index+1<n &&str[index-1]=='.' || str[index+1]=='.'){
                    if(str[index-1]=='.' && str[index+1]=='.')
                        count-=2;
                    else
                        count--;
                }
                str[index]=ch;
            }
            if(ch=='.' && str[index]!='.'){
                if(index==0 && index+1<n){
                    if(str[index+1]=='.')
                        count++;
                }
                else if(index==n-1 && index-1>=0){
                    if(str[index-1]=='.')
                        count++;
                }
                else if(index-1>=0 && index+1<n &&str[index-1]=='.' || str[index+1]=='.'){
                    if(str[index-1]=='.' && str[index+1]=='.')
                        count+=2;
                    else
                        count++;
                }
                str[index]=ch;
            }
            System.out.println(count);
        }
    }
}


import java.io.*;
import java.util.*;
public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int n=Integer.parseInt(st.nextToken());
        int m=Integer.parseInt(st.nextToken());
        char[] str=br.readLine().toCharArray();
        int i,count=0,begin=0;
        boolean started=false;
        for(i=0;i<n;i++){
            if(!started && str[i]=='.'){
                started=true;
                begin=i;
            }
            else if(started && str[i]!='.'){
                started=false;
                count+=i-begin-1;
            }
            else if(started && i==n-1)
                count+=i-begin;
        }
        //System.out.println(count);
        for(i=0;i<m;i++){
            st=new StringTokenizer(br.readLine());
            int index=Integer.parseInt(st.nextToken())-1;
            char ch=st.nextToken().charAt(0);
            if(ch!='.' && str[index]=='.'){
                if(index==0){
                    if(str[index+1]=='.')
                        count--;
                }
                else if(index==n-1){
                    if(str[index-1]=='.')
                        count--;
                }
                else if(str[index-1]=='.' || str[index+1]=='.'){
                    if(str[index-1]=='.' && str[index+1]=='.')
                        count-=2;
                    else
                        count--;
                }
                str[index]=ch;
            }
            if(ch=='.' && str[index]!='.'){
                if(index==0){
                    if(str[index+1]=='.')
                        count++;
                }
                else if(index==n-1){
                    if(str[index-1]=='.')
                        count++;
                }
                else if(str[index-1]=='.' || str[index+1]=='.'){
                    if(str[index-1]=='.' && str[index+1]=='.')
                        count+=2;
                    else
                        count++;
                }
                str[index]=ch;
            }
            System.out.println(count);
        }
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.StringTokenizer;

public class oneHundred_Problems {

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		int n = sc.nextInt();
		int m = sc.nextInt();
		char[] c = sc.next().toCharArray();
		int f = 0;
		int countDots = 0;
		for (int i = 0; i < c.length; i++) {
			if (c[i] == '.')
				countDots++;
			else {
				if(countDots != 0)
				f += (countDots - 1);
				countDots = 0;
			}
		}
		f += countDots - 1;
		while (m-- > 0) {
			int pos = sc.nextInt() - 1;
			char x = sc.next().charAt(0);
			if(x != '.') { // putting character
			if(pos != 0 && pos != c.length - 1)
			{
				if(c[pos] == '.' && c[pos + 1] == '.' && c[pos - 1] == '.') // in middle
					f -=2;
				else
					if((c[pos] == '.' && (c[pos - 1] == '.' && c[pos + 1] != '.') || ((c[pos] == '.' && (c[pos +1] == '.' && c[pos - 1] != '.'))))) // 2 cons dots
						f--;
			}
			else
			{
				if((pos == 0 && c[pos] == '.' && c[pos + 1] == '.') || (pos == c.length - 1 && c[pos] == '.' && c[pos - 1] == '.')) f--; // terminals

			}
			}
			else // putting dot
			{
				if(pos != 0 && pos != c.length - 1)
				{
					if(c[pos] != '.' && c[pos + 1] == '.' && c[pos - 1] == '.') // in middle
						f +=2;
					else
						if((c[pos] != '.' && (c[pos - 1] == '.' && c[pos + 1] != '.') || ((c[pos] == '.' && (c[pos +1] == '.' && c[pos - 1] != '.'))))) // 2 cons dots
							f++;
				}
				else
				{
					if((pos == 0 && c[pos] != '.' && c[pos + 1] == '.') || (pos == c.length - 1 && c[pos] != '.' &&  c[pos - 1] == '.')) f++; // terminals
				}
			}
			c[pos] = x;
			sb.append(f + "\n");
		}
		System.out.print(sb);

	}

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s) {
			br = new BufferedReader(new InputStreamReader(s));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public String nextLine() throws IOException {
			return br.readLine();
		}

		public boolean ready() throws IOException {
			return br.ready();
		}
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.StringTokenizer;

public class oneHundred_Problems {

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		int n = sc.nextInt();
		int m = sc.nextInt();
		char[] c = sc.next().toCharArray();
		int f = 0;
		int countDots = 0;
		for (int i = 0; i < c.length; i++) {
			if (c[i] == '.')
				countDots++;
			else {
				if(countDots != 0)
				f += (countDots - 1);
				countDots = 0;
			}
		}
		f += countDots - 1;
		while (m-- > 0) {
			int pos = sc.nextInt() - 1;
			char x = sc.next().charAt(0);
			if(x != '.') { // putting character
			if(pos != 0 && pos != c.length - 1)
			{
				if(c[pos] == '.' && c[pos + 1] == '.' && c[pos - 1] == '.') // in middle
					f -=2;
				else
					if((c[pos] == '.' && (c[pos - 1] == '.' && c[pos + 1] != '.') || ((c[pos] == '.' && (c[pos +1] == '.' && c[pos - 1] != '.'))))) // 2 cons dots
						f--;
			}
			else
			{
				if((pos == 0 && c[pos] == '.' && pos + 1 < c.length && c[pos + 1] == '.') || (pos == c.length - 1 && c[pos] == '.' && pos - 1 >= 0 && c[pos - 1] == '.')) f--; // terminals

			}
			}
			else // putting dot
			{
				if(pos != 0 && pos != c.length - 1)
				{
					if(c[pos] != '.' && c[pos + 1] == '.' && c[pos - 1] == '.') // in middle
						f +=2;
					else
						if((c[pos] != '.' && (c[pos - 1] == '.' && c[pos + 1] != '.') || ((c[pos] == '.' && (c[pos +1] == '.' && c[pos - 1] != '.'))))) // 2 cons dots
							f++;
				}
				else
				{
					if((pos == 0 && c[pos] != '.' && pos + 1 < c.length && c[pos + 1] == '.') || (pos == c.length - 1 && c[pos] != '.' && pos - 1 >= 0 &&  c[pos - 1] == '.')) f++; // terminals
				}
			}
			c[pos] = x;
			sb.append(f + "\n");
		}
		System.out.print(sb);

	}

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s) {
			br = new BufferedReader(new InputStreamReader(s));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public String nextLine() throws IOException {
			return br.readLine();
		}

		public boolean ready() throws IOException {
			return br.ready();
		}
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.StringTokenizer;

public class oneHundred_Problems {

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		int n = sc.nextInt();
		int m = sc.nextInt();
		char[] c = sc.next().toCharArray();
		int f = 0;
		int countDots = 0;
		for (int i = 0; i < c.length; i++) {
			if (c[i] == '.')
				countDots++;
			else {
				if (countDots != 0)
					f += (countDots - 1);
				countDots = 0;
			}
		}
		if (countDots != 0)
		f += countDots - 1;
		if(c.length == 1)
		{
			while(m -- > 0)
			{
				int pos = sc.nextInt();
				char x = sc.next().charAt(0);
				sb.append(0 + "\n");
			}
		}
		else {
			while(m-->0)
			{
				int pos = sc.nextInt() - 1;
				char x = sc.next().charAt(0);

				if(x != '.' && c[pos] == '.')
				{
					if(pos == 0 && c[pos + 1] == '.' || pos == c.length - 1 && c[pos - 1] == '.') f--;
					else{
						if(pos + 1 < c.length && pos - 1 >= 0 && c[pos + 1] == '.' && c[pos - 1] == '.') f-=2;
						else
							if((pos + 1 < c.length && c[pos + 1] == '.') || (pos - 1 >=0 && c[pos - 1] == '.')) f--;
					}

				}
				else
				{
					if(x == '.' && c[pos] != '.')
					{
						if(pos == 0 && c[pos + 1] == '.' || pos == c.length - 1 && c[pos - 1] == '.') f++;
						else{
							if(pos + 1 < c.length && pos - 1 >= 0 && c[pos + 1] == '.' && c[pos - 1] == '.') f+=2;
							else
								if((pos + 1 < c.length && c[pos + 1] == '.') || (pos - 1 >=0 && c[pos - 1] == '.')) f++;
						}

					}
				}
				c[pos] = x;
				sb.append(f + "\n");
			}

		}
		System.out.print(sb);

	}

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s) {
			br = new BufferedReader(new InputStreamReader(s));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public String nextLine() throws IOException {
			return br.readLine();
		}

		public boolean ready() throws IOException {
			return br.ready();
		}
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.StringTokenizer;

public class oneHundred_Problems {

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		int n = sc.nextInt();
		int m = sc.nextInt();
		char[] c = sc.next().toCharArray();
		int f = 0;
		int countDots = 0;
		for (int i = 0; i < c.length; i++) {
			if (c[i] == '.')
				countDots++;
			else {
				if (countDots != 0)
					f += (countDots - 1);
				countDots = 0;
			}
		}
		if (countDots != 0)
		f += countDots - 1;
		while (m-- > 0) {
			int pos = sc.nextInt() - 1;
			char x = sc.next().charAt(0);
			if (x != '.') { // putting character
				if (pos != 0 && pos != c.length - 1) {
					if (c[pos] == '.' && c[pos + 1] == '.' && c[pos - 1] == '.')
						f -= 2;
					else if ((c[pos] == '.' && (c[pos - 1] == '.' && c[pos + 1] != '.')
							|| ((c[pos] == '.' && (c[pos + 1] == '.' && c[pos - 1] != '.')))))
						f--;
				} else {
					if ((pos == 0 && c[pos] == '.' && pos + 1 < c.length && c[pos + 1] == '.')
							|| (pos == c.length - 1 && c[pos] == '.' && pos - 1 >= 0 && c[pos - 1] == '.')) {
												f--;
					}

				}
			} else // putting dot
			{
				if (pos != 0 && pos != c.length - 1) {
					if (c[pos] != '.' && c[pos + 1] == '.' && c[pos - 1] == '.')
						f += 2;
					else if ((c[pos] != '.' && (c[pos - 1] == '.' && c[pos + 1] != '.')
							|| ((c[pos] == '.' && (c[pos + 1] == '.' && c[pos - 1] != '.')))))
						f++;
				} else {
					if ((pos == 0 && c[pos] != '.' && pos + 1 < c.length && c[pos + 1] == '.')
							|| (pos == c.length - 1 && c[pos] != '.' && pos - 1 >= 0 && c[pos - 1] == '.'))
						f++;
				}
			}
			c[pos] = x;
			sb.append(f + "\n");
		}
		System.out.print(sb);

	}

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s) {
			br = new BufferedReader(new InputStreamReader(s));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public String nextLine() throws IOException {
			return br.readLine();
		}

		public boolean ready() throws IOException {
			return br.ready();
		}
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.StringTokenizer;

public class oneHundred_Problems {

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		int n = sc.nextInt();
		int m = sc.nextInt();
		char[] c = sc.next().toCharArray();
		int f = 0;
		int countDots = 0;
		for (int i = 0; i < c.length; i++) {
			if (c[i] == '.')
				countDots++;
			else {
				if (countDots != 0)
					f += (countDots - 1);
				countDots = 0;
			}
		}
		if (countDots != 0)
		f += countDots - 1;
		while (m-- > 0) {
			int pos = sc.nextInt() - 1;
			char x = sc.next().charAt(0);
			if (x != '.') { // putting character
				if (pos != 0 && pos != c.length - 1) {
					if (c[pos] == '.' && c[pos + 1] == '.' && c[pos - 1] == '.') // in
																					// middle
						f -= 2;
					else if ((c[pos] == '.' && (c[pos - 1] == '.' && c[pos + 1] != '.')
							|| ((c[pos] == '.' && (c[pos + 1] == '.' && c[pos - 1] != '.'))))) // 2
																								// cons
																								// dots
						f--;
				} else {
					if ((pos == 0 && c[pos] == '.' && pos + 1 < c.length && c[pos + 1] == '.')
							|| (pos == c.length - 1 && c[pos] == '.' && pos - 1 >= 0 && c[pos - 1] == '.')) {
												f--;
					}

				}
			} else // putting dot
			{
				if (pos != 0 && pos != c.length - 1) {
					if (c[pos] != '.' && c[pos + 1] == '.' && c[pos - 1] == '.') // in
																					// middle
						f += 2;
					else if ((c[pos] != '.' && (c[pos - 1] == '.' && c[pos + 1] != '.')
							|| ((c[pos] == '.' && (c[pos + 1] == '.' && c[pos - 1] != '.'))))) // 2
																								// cons
																								// dots
						f++;
				} else {
					if ((pos == 0 && c[pos] != '.' && pos + 1 < c.length && c[pos + 1] == '.')
							|| (pos == c.length - 1 && c[pos] != '.' && pos - 1 >= 0 && c[pos - 1] == '.'))
						f++; // terminals
				}
			}
			c[pos] = x;
			sb.append(f + "\n");
		}
		System.out.print(sb);

	}

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s) {
			br = new BufferedReader(new InputStreamReader(s));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public String nextLine() throws IOException {
			return br.readLine();
		}

		public boolean ready() throws IOException {
			return br.ready();
		}
	}
}


package pkg570c;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {

    public static void main(String[] args) {

        FastReader in=new FastReader();
        int a=in.nextInt(),b=in.nextInt();
        String s=in.next();
        while(b-->0)
        {
            int c=in.nextInt();String c1=in.next();

            char []s1=s.toCharArray();
            s1[c-1]=c1.charAt(0);
            s="";
            for (int i = 0; i < s1.length; i++)
            {
                s+=s1[i];
            }

            char []s2=s1;
            int co=0;
            for(int i=0;i<s2.length-1;i++)
            {
                String e=s2[i]+""+s2[i+1];
                if(e.equals("..")){co++;s2[i]='/';}

            }
            System.out.println(co);
        }
    }
}

class FastReader{
    BufferedReader br ;
    StringTokenizer st;

    public FastReader(){
        InputStreamReader inr =new InputStreamReader(System.in);
        br=new BufferedReader(inr);

    }

    String next(){
        while(st==null || !st.hasMoreElements()){
        try{
        st=new StringTokenizer(br.readLine());
        }
        catch(IOException e){
            e.printStackTrace();
        }}
        return st.nextToken();
    }

    int nextInt(){
        return Integer.parseInt(next());
    }

    double nextDouble(){
        return Double.parseDouble(next());

    }

    long nextLong(){
        return Long.parseLong(next());
    }

    String nextLine(){
        String str="";
        try{
            str=br.readLine();
        }
        catch(IOException e)
        {
            e.printStackTrace();
        }
        return str;
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.Scanner;
import java.util.StringTokenizer;

public class Main {

    public static void main(String[] args) {

        //PrintWriter out=new PrintWriter(new OutputStreamWriter(System.out));
        //FastReader in=new FastReader();
        Scanner in=new Scanner (System.in);
        int a=in.nextInt(),b=in.nextInt();
        String s=in.next();
        while(b-->0)
        {
            int c=in.nextInt();String c1=in.next();

            char []s1=s.toCharArray();
            s1[c-1]=c1.charAt(0);
            s="";
            for (int i = 0; i < s1.length; i++)
            {
                s+=s1[i];
            }

            char []s2=s1;
            int co=0;
            for(int i=0;i<s2.length-1;i++)
            {
                String e=s2[i]+""+s2[i+1];
                if(e.equals("..")){co++;s2[i]='/';}

            }
            //out.println(co);
            System.out.println(co);
        }
    }
}


package pkg570c;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.Scanner;
import java.util.StringTokenizer;

public class Main {

    public static void main(String[] args) {

        FastReader in=new FastReader();
        int a=in.nextInt(),b=in.nextInt();
        String s=in.next();
        while(b-->0)
        {
            int c=in.nextInt();String c1=in.next();
            char []s1=s.toCharArray();
            s1[c-1]=c1.charAt(0);
            int ans=0,e=0;
            for (int i = 0; i <s1.length; i++)
            {
                if(s1[i]!='.')
                {
                    if(e>=2)ans+=e-1;
                    e=0;
                }
                else e++;

            }
            if(e>=2)ans+=e-1;
            System.out.println(ans);
        }
    }
}

class FastReader{
    BufferedReader br ;
    StringTokenizer st;

    public FastReader(){
        InputStreamReader inr =new InputStreamReader(System.in);
        br=new BufferedReader(inr);

    }

    String next(){
        while(st==null || !st.hasMoreElements()){
        try{
        st=new StringTokenizer(br.readLine());
        }
        catch(IOException e){
            e.printStackTrace();
        }}
        return st.nextToken();
    }

    int nextInt(){
        return Integer.parseInt(next());
    }

    double nextDouble(){
        return Double.parseDouble(next());

    }

    long nextLong(){
        return Long.parseLong(next());
    }

    String nextLine(){
        String str="";
        try{
            str=br.readLine();
        }
        catch(IOException e)
        {
            e.printStackTrace();
        }
        return str;
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {

    public static void main(String[] args) {

        FastReader in=new FastReader();
        int a=in.nextInt(),b=in.nextInt();
        String s=in.next();
        while(b-->0)
        {
            int c=in.nextInt();String c1=in.next();

            char []s1=s.toCharArray();
            s1[c-1]=c1.charAt(0);
            s="";
            for (int i = 0; i < s1.length; i++)
            {
                s+=s1[i];
            }

            char []s2=s1;
            int co=0;
            for(int i=0;i<s2.length-1;i++)
            {
                String e=s2[i]+""+s2[i+1];
                if(e.equals("..")){co++;s2[i]='/';}

            }
            System.out.println(co);
        }
    }
}

class FastReader{
    BufferedReader br ;
    StringTokenizer st;

    public FastReader(){
        InputStreamReader inr =new InputStreamReader(System.in);
        br=new BufferedReader(inr);

    }

    String next(){
        while(st==null || !st.hasMoreElements()){
        try{
        st=new StringTokenizer(br.readLine());
        }
        catch(IOException e){
            e.printStackTrace();
        }}
        return st.nextToken();
    }

    int nextInt(){
        return Integer.parseInt(next());
    }

    double nextDouble(){
        return Double.parseDouble(next());

    }

    long nextLong(){
        return Long.parseLong(next());
    }

    String nextLine(){
        String str="";
        try{
            str=br.readLine();
        }
        catch(IOException e)
        {
            e.printStackTrace();
        }
        return str;
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.Scanner;
import java.util.StringTokenizer;

public class Main {

    public static void main(String[] args) {

        FastReader in=new FastReader();
        int n=in.nextInt(),b=in.nextInt();
        String s=in.next();
        char []s1=s.toCharArray();
            int ans=0,e=0;
            for (int i = 0; i <s1.length; i++)
            {
                if(s1[i]!='.')
                {
                    if(e>=2)ans+=e-1;
                    e=0;
                }
                else e++;
            }
            if(e!=0)ans+=e-1;
            for (int i = 0; i < b; i++)
            {
                int x=in.nextInt()-1;char c=in.next().charAt(0);
                if(x>0&&s1[x-1]=='.')
                {
                    if(s1[x]=='.' && c!='.')ans--;
                    else if(s1[x]!='.' && c=='.')ans++;
                }
                if(x<n-1 && s1[x+1]=='.')
                {
                    if(s1[x]=='.' && c!='.')ans--;
                    else if(s1[x]!='.' && c=='.')ans++;
                }
                s1[x]=c;
                System.out.println(ans);
            }
        //    System.out.println(ans);

    }
}

class FastReader{
    BufferedReader br ;
    StringTokenizer st;

    public FastReader(){
        InputStreamReader inr =new InputStreamReader(System.in);
        br=new BufferedReader(inr);

    }

    String next(){
        while(st==null || !st.hasMoreElements()){
        try{
        st=new StringTokenizer(br.readLine());
        }
        catch(IOException e){
            e.printStackTrace();
        }}
        return st.nextToken();
    }

    int nextInt(){
        return Integer.parseInt(next());
    }

    double nextDouble(){
        return Double.parseDouble(next());

    }

    long nextLong(){
        return Long.parseLong(next());
    }

    String nextLine(){
        String str="";
        try{
            str=br.readLine();
        }
        catch(IOException e)
        {
            e.printStackTrace();
        }
        return str;
    }
}


package pkg570c;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.Scanner;
import java.util.StringTokenizer;

public class Main {

    public static void main(String[] args) {

        FastReader in=new FastReader();
        int a=in.nextInt(),b=in.nextInt();
        String s=in.next();
        char []s1=s.toCharArray();
        while(b-->0)
        {
            int c=in.nextInt();String c1=in.next();

            s1[c-1]=c1.charAt(0);

            int ans=0,e=0;
            for (int i = 0; i <s1.length; i++)
            {
                if(s1[i]!='.')
                {
                    if(e>=2)ans+=e-1;
                    e=0;
                }
                else e++;
            }
            if(e!=0)ans+=e-1;
            System.out.println(ans);
        }
    }
}

class FastReader{
    BufferedReader br ;
    StringTokenizer st;

    public FastReader(){
        InputStreamReader inr =new InputStreamReader(System.in);
        br=new BufferedReader(inr);

    }

    String next(){
        while(st==null || !st.hasMoreElements()){
        try{
        st=new StringTokenizer(br.readLine());
        }
        catch(IOException e){
            e.printStackTrace();
        }}
        return st.nextToken();
    }

    int nextInt(){
        return Integer.parseInt(next());
    }

    double nextDouble(){
        return Double.parseDouble(next());

    }

    long nextLong(){
        return Long.parseLong(next());
    }

    String nextLine(){
        String str="";
        try{
            str=br.readLine();
        }
        catch(IOException e)
        {
            e.printStackTrace();
        }
        return str;
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.Scanner;
import java.util.StringTokenizer;

public class Main {

    public static void main(String[] args) {

        //PrintWriter out=new PrintWriter(new OutputStreamWriter(System.out));
        FastReader in=new FastReader();
        int a=in.nextInt(),b=in.nextInt();
        String s=in.next();
        while(b-->0)
        {
            int c=in.nextInt();String c1=in.next();

            char []s1=s.toCharArray();
            s1[c-1]=c1.charAt(0);
            s="";
            for (int i = 0; i < s1.length; i++)
            {
                s+=s1[i];
            }

            char []s2=s1;

            int ans=0,e=0;
            for (int i = 0; i <s2.length; i++)
            {
                if(s2[i]!='.')
                {
                    if(e>=2)ans+=e-1;
                    e=0;
                }
                else e++;

            }
            if(e>=2)ans+=e-1;
            System.out.println(ans);
        }
    }
}

class FastReader{
    BufferedReader br ;
    StringTokenizer st;

    public FastReader(){
        InputStreamReader inr =new InputStreamReader(System.in);
        br=new BufferedReader(inr);

    }

    String next(){
        while(st==null || !st.hasMoreElements()){
        try{
        st=new StringTokenizer(br.readLine());
        }
        catch(IOException e){
            e.printStackTrace();
        }}
        return st.nextToken();
    }

    int nextInt(){
        return Integer.parseInt(next());
    }

    double nextDouble(){
        return Double.parseDouble(next());

    }

    long nextLong(){
        return Long.parseLong(next());
    }

    String nextLine(){
        String str="";
        try{
            str=br.readLine();
        }
        catch(IOException e)
        {
            e.printStackTrace();
        }
        return str;
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.Scanner;
import java.util.StringTokenizer;

public class Main {

    public static void main(String[] args) {

        //PrintWriter out=new PrintWriter(new OutputStreamWriter(System.out));
        //FastReader in=new FastReader();
        Scanner in=new Scanner (System.in);
        int a=in.nextInt(),b=in.nextInt();
        String s=in.next();
        while(b-->0)
        {
            int c=in.nextInt();String c1=in.next();

            char []s1=s.toCharArray();
            s1[c-1]=c1.charAt(0);
            s="";
            for (int i = 0; i < s1.length; i++)
            {
                s+=s1[i];
            }

            char []s2=s1;
            int co=0;
            for(int i=0;i<s2.length-1;i++)
            {
                String e=s2[i]+""+s2[i+1];
                if(e.equals("..")){co++;s2[i]='/';}

            }
            //out.println(co);
        }
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.Scanner;
import java.util.StringTokenizer;

public class Main {

    public static void main(String[] args) {

        FastReader in=new FastReader();
        int a=in.nextInt(),b=in.nextInt();
        String s=in.next();
        char []s1=s.toCharArray();
        while(b-->0)
        {
            int c=in.nextInt();String c1=in.next();

            s1[c-1]=c1.charAt(0);

            int ans=0,e=0;
            for (int i = 0; i <s1.length; i++)
            {
                if(s1[i]!='.')
                {
                    if(e>=2)ans+=e-1;
                    e=0;
                }
                else e++;
            }
            if(e!=0)ans+=e-1;
            System.out.println(ans);
        }
    }
}

class FastReader{
    BufferedReader br ;
    StringTokenizer st;

    public FastReader(){
        InputStreamReader inr =new InputStreamReader(System.in);
        br=new BufferedReader(inr);

    }

    String next(){
        while(st==null || !st.hasMoreElements()){
        try{
        st=new StringTokenizer(br.readLine());
        }
        catch(IOException e){
            e.printStackTrace();
        }}
        return st.nextToken();
    }

    int nextInt(){
        return Integer.parseInt(next());
    }

    double nextDouble(){
        return Double.parseDouble(next());

    }

    long nextLong(){
        return Long.parseLong(next());
    }

    String nextLine(){
        String str="";
        try{
            str=br.readLine();
        }
        catch(IOException e)
        {
            e.printStackTrace();
        }
        return str;
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.Scanner;
import java.util.StringTokenizer;

public class Main {

    public static void main(String[] args) {

        FastReader in=new FastReader();
        int a=in.nextInt(),b=in.nextInt();
        String s=in.next();
        while(b-->0)
        {
            int c=in.nextInt();String c1=in.next();
            char []s1=s.toCharArray();
            s1[c-1]=c1.charAt(0);
            int ans=0,e=0;
            for (int i = 0; i <s1.length; i++)
            {
                if(s1[i]!='.')
                {
                    if(e>=2)ans+=e-1;
                    e=0;
                }
                else e++;

            }
            if(e>=2)ans+=e-1;
            System.out.println(ans);
        }
    }
}

class FastReader{
    BufferedReader br ;
    StringTokenizer st;

    public FastReader(){
        InputStreamReader inr =new InputStreamReader(System.in);
        br=new BufferedReader(inr);

    }

    String next(){
        while(st==null || !st.hasMoreElements()){
        try{
        st=new StringTokenizer(br.readLine());
        }
        catch(IOException e){
            e.printStackTrace();
        }}
        return st.nextToken();
    }

    int nextInt(){
        return Integer.parseInt(next());
    }

    double nextDouble(){
        return Double.parseDouble(next());

    }

    long nextLong(){
        return Long.parseLong(next());
    }

    String nextLine(){
        String str="";
        try{
            str=br.readLine();
        }
        catch(IOException e)
        {
            e.printStackTrace();
        }
        return str;
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws IOException{
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String[] input = in.readLine().split(" ");
		int length = Integer.parseInt(input[0]),
				count = Integer.parseInt(input[1]);

		char[] str = in.readLine().toCharArray();
		int re = replace(str);

		int[] result = new int[count];
		result[0] = re;
		int no;
		char replace;

		for(int i = 0; i < count; i++){
			if(i > 0)
				result[i] = result[i-1];
			String[] input1 = in.readLine().split(" ");
			no = Integer.parseInt(input1[0]) - 1;
			replace = input1[1].charAt(0);
			if(replace == '.'){
				if(str[no] != '.'){
					if(length == 1){
						continue;
					}else if(no == 0){
						if(str[no+1] == '.'){
							result[i]++;
						}
					}else if(no == length -1) {
						if(str[no-1] == '.'){
							result[i]++;
						}
					}else {
						if(str[no+1] == '.'){
							result[i]++;
						}
						if(str[no-1] == '.'){
							result[i]++;
						}
					}
				}
			}else {
				if(str[no] == '.'){
					if(length == 1){
						continue;
					}else if(no == 0){
						if(str[no+1] == '.'){
							result[i]--;
						}
					}else if(no == length -1){
						if(str[no-1] == '.'){
							result[i]--;
						}
					}else {
						if(str[no-1] == '.'){
							result[i]--;
						}
						if(str[no+1] == '.'){
							result[i]--;
						}
					}
				}
			}
			str[no] = replace;
		}
		for(int i = 0; i < count; i++){
			System.out.println(result[i]);
		}
	}

	public static int replace(char[] str){
		int result = 0;
		for(int i = 0; i < str.length -1; i++){
			if(str[i] == '.'){
				if(str[i+1] == '.'){
					result++;
				}
			}
		}
		return result;
	}
}


import java.util.Scanner;

public class Main750C {
	public static void main(String[] args){
		Scanner in = new Scanner(System.in);
		int length = in.nextInt(),
				count = in.nextInt();

		char[] str = in.next().toCharArray();
		int re = replace(str);

		int[] result = new int[count];
		result[0] = re;
		int no;
		char replace;

		for(int i = 0; i < count; i++){
			if(i > 0)
				result[i] = result[i-1];
			no = in.nextInt() - 1;
			replace = in.next().charAt(0);
			if(replace == '.'){
				if(str[no] != '.'){
					if(no == 0){
						if(str[no+1] == '.'){
							result[i]++;
						}
					}else if(no == length -1) {
						if(str[no-1] == '.'){
							result[i]++;
						}
					}else {
						if(str[no+1] == '.'){
							result[i]++;
						}
						if(str[no-1] == '.'){
							result[i]++;
						}
					}
				}
			}else {
				if(str[no] == '.'){
					if(no == 0){
						if(str[no+1] == '.'){
							result[i]--;
						}
					}else if(no == length -1){
						if(str[no-1] == '.'){
							result[i]--;
						}
					}else {
						if(str[no-1] == '.'){
							result[i]--;
						}
						if(str[no+1] == '.'){
							result[i]--;
						}
					}
				}
			}
		}
		in.close();
		for(int i = 0; i < count; i++){
			System.out.println(result[i]);
		}
	}

	public static int replace(char[] str){
		int result = 0;
		for(int i = 0; i < str.length -1; i++){
			if(str[i] == '.'){
				if(str[i+1] == '.'){
					result++;
				}
			}
		}
		return result;
	}
}


import java.util.ArrayList;
import java.util.Scanner;

public class Main750C {
	public static void main(String[] args){
		Scanner in = new Scanner(System.in);
		int length = in.nextInt(),
				count = in.nextInt();

		char[] str = new char[length];
		in.next().getChars(0, length, str, 0);

		int[] no = new int[count];
		char[] replace = new char[count];
		for(int i = 0; i < count; i++){
			no[i] = in.nextInt();
			replace[i] = in.next().charAt(0);
		}
		in.close();

		for(int i = 0; i < count; i++){
			str[no[i] - 1] = replace[i];
			ArrayList<Character> list = new ArrayList<Character>();
			for(int i1 = 0; i1 < length; i1++){
				list.add(str[i1]);
			}
			System.out.println(replace(list));
		}
	}

	public static int replace(ArrayList<Character> str){
		int result = 0;
		boolean flag = true;

		while(flag){
			int count = 0;
			for(int i = 0; i < str.size() -1; i++){
				if(str.get(i).equals('.') && str.get(i+1).equals('.')){
					str.remove(i);
					count++;
					result++;
					continue;
				}
			}
			if (count == 0) {
				flag = false;
			}
		}

		return result;
	}
}


import java.util.Scanner;

public class Main750C {
	public static void main(String[] args){
		Scanner in = new Scanner(System.in);
		int length = in.nextInt(),
				count = in.nextInt();

		char[] str = in.next().toCharArray();
		int re = replace(str);

		int[] result = new int[count];
		result[0] = re;
		int no;
		char replace;

		for(int i = 0; i < count; i++){
			if(i > 0)
				result[i] = result[i-1];
			no = in.nextInt() - 1;
			replace = in.next().charAt(0);
			if(replace == '.'){
				if(str[no] != '.'){
					if(no == 0){
						if(str[no+1] == '.'){
							result[i]++;
						}
					}else if(no == length -1) {
						if(str[no-1] == '.'){
							result[i]++;
						}
					}else {
						if(str[no+1] == '.'){
							result[i]++;
						}
						if(str[no-1] == '.'){
							result[i]++;
						}
					}
				}
			}else {
				if(str[no] == '.'){
					if(no == 0){
						if(str[no+1] == '.'){
							result[i]--;
						}
					}else if(no == length -1){
						if(str[no-1] == '.'){
							result[i]--;
						}
					}else {
						if(str[no-1] == '.'){
							result[i]--;
						}
						if(str[no+1] == '.'){
							result[i]--;
						}
					}
				}
			}
			str[no] = replace;
		}
		in.close();
		for(int i = 0; i < count; i++){
			System.out.println(result[i]);
		}
	}

	public static int replace(char[] str){
		int result = 0;
		for(int i = 0; i < str.length -1; i++){
			if(str[i] == '.'){
				if(str[i+1] == '.'){
					result++;
				}
			}
		}
		return result;
	}
}


import java.util.Scanner;

public class Main750C {
	public static void main(String[] args){
		Scanner in = new Scanner(System.in);
		int length = in.nextInt(),
				count = in.nextInt();

		char[] str = in.next().toCharArray();
		int re = replace(str);

		int[] result = new int[count];
		result[0] = re;
		int no;
		char replace;

		for(int i = 0; i < count; i++){
			if(i > 0)
				result[i] = result[i-1];
			no = in.nextInt() - 1;
			replace = in.next().charAt(0);
			if(replace == '.'){
				if(str[no] != '.'){
					if(length == 1){
						continue;
					}else if(no == 0){
						if(str[no+1] == '.'){
							result[i]++;
						}
					}else if(no == length -1) {
						if(str[no-1] == '.'){
							result[i]++;
						}
					}else {
						if(str[no+1] == '.'){
							result[i]++;
						}
						if(str[no-1] == '.'){
							result[i]++;
						}
					}
				}
			}else {
				if(str[no] == '.'){
					if(length == 1){
						continue;
					}else if(no == 0){
						if(str[no+1] == '.'){
							result[i]--;
						}
					}else if(no == length -1){
						if(str[no-1] == '.'){
							result[i]--;
						}
					}else {
						if(str[no-1] == '.'){
							result[i]--;
						}
						if(str[no+1] == '.'){
							result[i]--;
						}
					}
				}
			}
			str[no] = replace;
		}
		in.close();
		for(int i = 0; i < count; i++){
			System.out.println(result[i]);
		}
	}

	public static int replace(char[] str){
		int result = 0;
		for(int i = 0; i < str.length -1; i++){
			if(str[i] == '.'){
				if(str[i+1] == '.'){
					result++;
				}
			}
		}
		return result;
	}
}


import java.util.Scanner;

public class Main750C {
	public static void main(String[] args){
		Scanner in = new Scanner(System.in);
		int length = in.nextInt(),
				count = in.nextInt();

		char[] str = new char[length];
		in.next().getChars(0, length, str, 0);

		int[] no = new int[count];
		char[] replace = new char[count];
		for(int i = 0; i < count; i++){
			no[i] = in.nextInt();
			replace[i] = in.next().charAt(0);
		}
		in.close();

		for(int i = 0; i < count; i++){
			str[no[i] - 1] = replace[i];
			System.out.println(replace(str));
		}
	}

	public static int replace(char[] str){
		int result = 0;
		for(int i = 0; i < str.length -1; i++){
			if(str[i] == '.'){
				if(str[i+1] == '.'){
					result++;
				}
			}
		}
		return result;
	}
}


import java.util.Scanner;

public class Main750C {
	public static void main(String[] args){
		Scanner in = new Scanner(System.in);
		int length = in.nextInt(),
				count = in.nextInt();

		char[] str = in.next().toCharArray();
		int re = replace(str);

		int[] result = new int[count];
		result[0] = re;
		int no;
		char replace;

		for(int i = 0; i < count; i++){
			if(i > 0)
				result[i] = result[i-1];
			no = in.nextInt() - 1;
			replace = in.next().charAt(0);
			if(replace == '.'){
				if(str[no] != '.'){
					if(length == 1){
						;
					}else if(no == 0){
						if(str[no+1] == '.'){
							result[i]++;
						}
					}else if(no == length -1) {
						if(str[no-1] == '.'){
							result[i]++;
						}
					}else {
						if(str[no+1] == '.'){
							result[i]++;
						}
						if(str[no-1] == '.'){
							result[i]++;
						}
					}
				}
			}else {
				if(str[no] == '.'){
					if(length == 1){
						;
					}else if(no == 0){
						if(str[no+1] == '.'){
							result[i]--;
						}
					}else if(no == length -1){
						if(str[no-1] == '.'){
							result[i]--;
						}
					}else {
						if(str[no-1] == '.'){
							result[i]--;
						}
						if(str[no+1] == '.'){
							result[i]--;
						}
					}
				}
			}
			str[no] = replace;
		}
		in.close();
		for(int i = 0; i < count; i++){
			System.out.println(result[i]);
		}
	}

	public static int replace(char[] str){
		int result = 0;
		for(int i = 0; i < str.length -1; i++){
			if(str[i] == '.'){
				if(str[i+1] == '.'){
					result++;
				}
			}
		}
		return result;
	}
}


import java.util.LinkedList;
import java.util.Scanner;

public class Main750C {
	public static void main(String[] args){
		Scanner in = new Scanner(System.in);
		int length = in.nextInt(),
				count = in.nextInt();

		char[] str = new char[length];
		in.next().getChars(0, length, str, 0);

		int[] no = new int[count];
		char[] replace = new char[count];
		for(int i = 0; i < count; i++){
			no[i] = in.nextInt();
			replace[i] = in.next().charAt(0);
		}
		in.close();

		for(int i = 0; i < count; i++){
			str[no[i] - 1] = replace[i];
			LinkedList<Character> list = new LinkedList<Character>();
			for(int i1 = 0; i1 < length; i1++){
				list.add(str[i1]);
			}
			System.out.println(replace(list));
		}
	}

	public static int replace(LinkedList<Character> str){
		int result = 0;
		boolean flag = true;

		while(flag){
			int count = 0;
			for(int i = 0; i < str.size() -1; i++){
				if(str.get(i).equals('.') && str.get(i+1).equals('.')){
					str.remove(i);
					count++;
					result++;
				}
			}
			if (count == 0) {
				flag = false;
			}
		}

		return result;
	}
}