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

public class cf570c implements Runnable {
	public static final String taskname = cf570c.class.getName();

	public StringTokenizer strtok;
	public BufferedReader inr;
	public PrintWriter out;

	public static void main(String[] args) {
		new Thread(new cf570c()).start();
	}

	public void run() {
		Locale.setDefault(Locale.US);
		boolean oj = System.getProperty("ONLINE_JUDGE") != null;
		try {
			inr = new BufferedReader(oj ? new InputStreamReader(System.in, "ISO-8859-1") : new FileReader(taskname + ".in"));
			out = new PrintWriter(oj ? new OutputStreamWriter(System.out, "ISO-8859-1") : new FileWriter(taskname + ".out"));
			solve();
		} catch (Exception e) {
			if (!oj)
				e.printStackTrace();
			System.exit(9000);
		} finally {
			out.flush();
			out.close();
		}
	}

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

	public int nextInt() throws NumberFormatException, IOException {
		return Integer.parseInt(nextToken());
	}

	public long nextLong() throws NumberFormatException, IOException {
		return Long.parseLong(nextToken());
	}

	public double nextDouble() throws NumberFormatException, IOException {
		return Double.parseDouble(nextToken());
	}

	// Debugging

	public static void printArray(boolean[][] a) {
		for (int i = 0; i < a.length; i++) {
			for (int j = 0; j < a[i].length; j++) {
				System.out.print(a[i][j] ? '#' : '.');
			}
			System.out.print('\n');
		}
	}

	// Solution

	public void solve() throws NumberFormatException, IOException {
		// TODO: write solution
		int n = nextInt(), m = nextInt();
		String s = nextToken();
		char[] arr = s.toCharArray();
		TreeMap<Integer, Integer> t = new TreeMap<Integer, Integer>();
		boolean in_dots = false;
		int start = -1;
		int totalCount = 0;
		for (int i = 0; i < s.length(); i++) {
			if (in_dots && arr[i] != '.') {
				t.put(start, i - 1);
				in_dots = false;
				totalCount += i - start - 1;
			}
			else if (!in_dots && arr[i] == '.') {
				start = i;
				in_dots = true;
			}
		}
		if (in_dots) {
			t.put(start, s.length() - 1);
			totalCount += s.length() - start - 1;
		}

		for (int i = 0; i < m; i++) {

			int x = nextInt() - 1;
			char c = nextToken().charAt(0);

			// update . -> c
			if (arr[x] == '.' && c != '.') {
				arr[x] = '*';
				Map.Entry<Integer, Integer> ent = t.floorEntry(x);
				if (ent.getValue() >= x) {
					// updating tree
					if (ent.getKey() == x) {
						// left side
						t.remove(ent.getKey());
						if (ent.getValue() >= x + 1) {
							t.put(x + 1, ent.getValue());
							totalCount -= 1;
						}
					}
					else if (ent.getValue() == x) {
						// right side
						if (ent.getKey() == ent.getValue()) {
							t.remove(ent.getKey());
						}
						else {
							t.put(ent.getKey(), ent.getValue() - 1);
							totalCount -= 1;
						}
					}
					else {
						// middle
						t.remove(ent.getKey());
						t.put(ent.getKey(), x - 1);
						t.put(x + 1, ent.getValue());
						totalCount -= 2;
					}
				}
			}
			else if (arr[x] != '.' && c == '.') {
				arr[x] = '.';
				Map.Entry<Integer, Integer> left = t.floorEntry(x);
				Map.Entry<Integer, Integer> right = t.ceilingEntry(x);

				if (left.getValue() == x - 1 && right.getKey() == x + 1) {
					// merge
					t.remove(right.getKey());
					t.put(left.getKey(), right.getValue());
					totalCount += 2;
				}
				else if (left.getValue() == x - 1) {
					// merge with left
					t.put(left.getKey(), x);
					totalCount += 1;
				}
				else if (right.getKey() == x + 1) {
					// with right
					t.remove(right.getKey());
					t.put(x, right.getValue());
				}
			}

//			for (char cc : arr) {
//				System.out.print(cc);
//			}
//			System.out.println();

			out.println(totalCount);
		}
	}
}


import java.util.*;
import java.io.*;
/*

 */
public class eight
{
	public static void main(String[] arg) throws IOException
	{
		new eight();
	}

	public eight() throws IOException
	{
		//JoltyScanner in = new JoltyScanner(System.in);
		//FastInput in = new FastInput(System.in);
		FastScanner in = new FastScanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		int n = in.nextInt();
		int m = in.nextInt();
		char[] arr = in.next().toCharArray();
		int totalPeriods = 0;
		int totalGroups = 0;
		boolean flag = false;
		for(int i = 0; i < n; i++)
		{
			if(arr[i] == '.') totalPeriods++;
			if(flag && arr[i] != '.')
			{
				flag = false;
			}
			else if(!flag && arr[i] == '.')
			{
				flag = true;
				totalGroups++;
			}
		}
		//out.println(totalPeriods + " " + totalGroups);
		for(int cc = 1; cc <= m; cc++)
		{
			int index = in.nextInt()-1;
			char ch = in.next().charAt(0);
			if(ch == '.')
			{
				if(arr[index] == '.')
				{
					;
				}
				else
				{
					totalPeriods++;
					if(index-1 >= 0 && index+1 < n)
					{
						if(arr[index-1] == '.' && arr[index+1] == '.') totalGroups--;
					}
					else if(index-1 >= 0)
					{
						if(arr[index-1] != '.') totalGroups++;
					}
					else if(index+1 < n)
					{
						if(arr[index+1] != '.') totalGroups++;
					}
					else if(n == 1)
					{
						totalGroups++;
					}
				}
			}
			else
			{
				if(arr[index] != '.')
				{
					;
				}
				else
				{
					totalPeriods--;
					if(index-1 >= 0 && index+1 < n)
					{
						if(arr[index-1] == '.' && arr[index+1] == '.') totalGroups++;
					}
					else if(index-1 >= 0)
					{
						if(arr[index-1] != '.') totalGroups--;
					}
					else if(index+1 < n)
					{
						if(arr[index+1] != '.') totalGroups--;
					}
					else if(n == 1)
					{
						totalGroups--;
					}
				}
			}
			arr[index] = ch;
			//out.println(Arrays.toString(arr));
			//out.println(totalPeriods + " " + totalGroups);
			out.println(totalPeriods-totalGroups);
		}
		in.close(); out.close();
	}

	class FastInput
	{
		BufferedReader reader;
		StringTokenizer tokenizer;

		public FastInput(InputStream input)
		{
			reader = new BufferedReader(new InputStreamReader(input));
			tokenizer = new StringTokenizer("");
		}
		String next() throws IOException
		{
			while( ! tokenizer.hasMoreTokens() )
			{
				tokenizer = new StringTokenizer(reader.readLine());
			}
			return tokenizer.nextToken();
		}
		char nextChar() throws IOException { return next().charAt(0); }
		int nextInt() throws IOException { return Integer.parseInt(next()); }
		double nextDouble() throws IOException { return Double.parseDouble(next()); }
		long nextLong() throws IOException { return Long.parseLong(next()); }
		void close() throws IOException { reader.close(); }
	}
	class JoltyScanner
	{
	    public static final int BUFFER_SIZE = 1 << 16;
		public static final char NULL_CHAR = (char) -1;

	    byte[] buffer = new byte[BUFFER_SIZE];
		boolean EOF_FLAG = false;
		int bufferIdx = 0, size = 0;
		char c = NULL_CHAR;
		BufferedInputStream in;

		public JoltyScanner(InputStream in)
		{
			this.in = new BufferedInputStream(in, BUFFER_SIZE);
		}

		public int nextInt()
		{
			long x = nextLong();
			if (x > Integer.MAX_VALUE || x < Integer.MIN_VALUE)
			{
				throw new ArithmeticException("Scanned value overflows integer");
			}
			return (int) x;
		}

		public long nextLong()
		{
			boolean negative = false;
			if (c == NULL_CHAR)
			{
				c = nextChar();
			}
			for (; !EOF_FLAG && (c < '0' || c > '9'); c = nextChar())
			{
				if (c == '-')
				{
					negative = true;
				}
			}
			checkEOF();
			long res = 0;
			for (; c >= '0' && c <= '9'; c = nextChar())
			{
				res = (res << 3) + (res << 1) + c - '0';
			}
			return negative ? -res : res;
		}

	    public char nextChar()
	    {
			if (EOF_FLAG)
			{
				return NULL_CHAR;
			}
			while (bufferIdx == size)
			{
				try
				{
					size = in.read(buffer);
					if (size == -1)
					{
						throw new Exception();
					}
				}
				catch (Exception e)
				{
					EOF_FLAG = true;
					return NULL_CHAR;
				}
				if (size == -1)
				{
					size = BUFFER_SIZE;
				}
				bufferIdx = 0;
			}
			return (char) buffer[bufferIdx++];
		}

	    public void checkEOF()
	    {
			if (EOF_FLAG)
			{
				throw new EndOfFileException();
			}
		}
	    public void close()
	    {
	    	;
	    }
		public class EndOfFileException extends RuntimeException
		{
		}
	}
	class FastScanner
	{
		final BufferedReader reader;
		String line;
		int index;
		public FastScanner(InputStream in)
		{
			reader = new BufferedReader(new InputStreamReader(in));
		}
		public String readLine()
		{
			try
			{
				String line = reader.readLine();
				if(line == null) throw new IOException("End of stream");
				return line;
			}
			catch(IOException exception)
			{
				throw new RuntimeException(exception);
			}
		}
		public String nextLine()
		{
			if(line==null) return readLine();
			String s = line;
			line = null;
			return s.substring(index);
		}
		public String next()
		{
			if(line == null)
			{
				line = readLine();
				index = 0;
			}
			while(index >= line.length())
			{
				line = readLine();
				index = 0;
			}
			while(Character.isWhitespace(line.charAt(index)))
			{
				index++;
				while(index >= line.length())
				{
					line = readLine();
					index = 0;
				}
			}
			int endIndex = index;
			while(endIndex < line.length() && !Character.isWhitespace(line.charAt(endIndex)))
				endIndex++;
			String s = line.substring(index, endIndex);
			index = endIndex;
			return s;
		}
		public int nextInt() { return Integer.parseInt(next()); }
		public long nextLong() { return Long.parseLong(next()); }
		public double nextDouble() { return Double.parseDouble(next()); }
		public void close() {;}
	}
}


import java.util.*;
import java.io.*;
/*

 */
public class eight
{
	public static void main(String[] arg) throws IOException
	{
		new eight();
	}

	public eight() throws IOException
	{
		//JoltyScanner in = new JoltyScanner(System.in);
		//FastInput in = new FastInput(System.in);
		FastScanner in = new FastScanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		int n = in.nextInt();
		int m = in.nextInt();
		char[] arr = in.next().toCharArray();
		int totalPeriods = 0;
		int totalGroups = 0;
		boolean flag = false;
		for(int i = 0; i < n; i++)
		{
			if(arr[i] == '.') totalPeriods++;
			if(flag && arr[i] != '.')
			{
				flag = false;
			}
			else if(!flag && arr[i] == '.')
			{
				flag = true;
				totalGroups++;
			}
		}
		//out.println(totalPeriods + " " + totalGroups);
		for(int cc = 1; cc <= m; cc++)
		{
			int index = in.nextInt()-1;
			char ch = in.next().charAt(0);
			if(ch == '.')
			{
				if(arr[index] != '.')
				{
					// Im changing a non-period into a period
					totalPeriods++;
					if(index-1 >= 0 && index+1 < n)
					{
						if(arr[index-1] == '.' && arr[index+1] == '.') totalGroups--;
						if(arr[index-1] != '.' && arr[index+1] != '.') totalGroups++;
					}
					else if(index-1 >= 0)
					{
						if(arr[index-1] != '.') totalGroups++;
					}
					else if(index+1 < n)
					{
						if(arr[index+1] != '.') totalGroups++;
					}
					else if(n == 1)
					{
						totalGroups++;
					}
				}
			}
			else
			{
				if(arr[index] == '.')
				{
					//period -> non-period
					totalPeriods--;
					if(index-1 >= 0 && index+1 < n)
					{
						if(arr[index-1] == '.' && arr[index+1] == '.') totalGroups++;
						if(arr[index-1] != '.' && arr[index+1] != '.') totalGroups--;
					}
					else if(index-1 >= 0)
					{
						if(arr[index-1] != '.') totalGroups--;
					}
					else if(index+1 < n)
					{
						if(arr[index+1] != '.') totalGroups--;
					}
					else if(n == 1)
					{
						totalGroups--;
					}
				}
			}
			arr[index] = ch;
			//out.println(Arrays.toString(arr));
			//out.println(totalPeriods + " " + totalGroups);
			out.println(totalPeriods-totalGroups);
		}
		in.close(); out.close();
	}

	class FastInput
	{
		BufferedReader reader;
		StringTokenizer tokenizer;

		public FastInput(InputStream input)
		{
			reader = new BufferedReader(new InputStreamReader(input));
			tokenizer = new StringTokenizer("");
		}
		String next() throws IOException
		{
			while( ! tokenizer.hasMoreTokens() )
			{
				tokenizer = new StringTokenizer(reader.readLine());
			}
			return tokenizer.nextToken();
		}
		char nextChar() throws IOException { return next().charAt(0); }
		int nextInt() throws IOException { return Integer.parseInt(next()); }
		double nextDouble() throws IOException { return Double.parseDouble(next()); }
		long nextLong() throws IOException { return Long.parseLong(next()); }
		void close() throws IOException { reader.close(); }
	}
	class JoltyScanner
	{
	    public static final int BUFFER_SIZE = 1 << 16;
		public static final char NULL_CHAR = (char) -1;

	    byte[] buffer = new byte[BUFFER_SIZE];
		boolean EOF_FLAG = false;
		int bufferIdx = 0, size = 0;
		char c = NULL_CHAR;
		BufferedInputStream in;

		public JoltyScanner(InputStream in)
		{
			this.in = new BufferedInputStream(in, BUFFER_SIZE);
		}

		public int nextInt()
		{
			long x = nextLong();
			if (x > Integer.MAX_VALUE || x < Integer.MIN_VALUE)
			{
				throw new ArithmeticException("Scanned value overflows integer");
			}
			return (int) x;
		}

		public long nextLong()
		{
			boolean negative = false;
			if (c == NULL_CHAR)
			{
				c = nextChar();
			}
			for (; !EOF_FLAG && (c < '0' || c > '9'); c = nextChar())
			{
				if (c == '-')
				{
					negative = true;
				}
			}
			checkEOF();
			long res = 0;
			for (; c >= '0' && c <= '9'; c = nextChar())
			{
				res = (res << 3) + (res << 1) + c - '0';
			}
			return negative ? -res : res;
		}

	    public char nextChar()
	    {
			if (EOF_FLAG)
			{
				return NULL_CHAR;
			}
			while (bufferIdx == size)
			{
				try
				{
					size = in.read(buffer);
					if (size == -1)
					{
						throw new Exception();
					}
				}
				catch (Exception e)
				{
					EOF_FLAG = true;
					return NULL_CHAR;
				}
				if (size == -1)
				{
					size = BUFFER_SIZE;
				}
				bufferIdx = 0;
			}
			return (char) buffer[bufferIdx++];
		}

	    public void checkEOF()
	    {
			if (EOF_FLAG)
			{
				throw new EndOfFileException();
			}
		}
	    public void close()
	    {
	    	;
	    }
		public class EndOfFileException extends RuntimeException
		{
		}
	}
	class FastScanner
	{
		final BufferedReader reader;
		String line;
		int index;
		public FastScanner(InputStream in)
		{
			reader = new BufferedReader(new InputStreamReader(in));
		}
		public String readLine()
		{
			try
			{
				String line = reader.readLine();
				if(line == null) throw new IOException("End of stream");
				return line;
			}
			catch(IOException exception)
			{
				throw new RuntimeException(exception);
			}
		}
		public String nextLine()
		{
			if(line==null) return readLine();
			String s = line;
			line = null;
			return s.substring(index);
		}
		public String next()
		{
			if(line == null)
			{
				line = readLine();
				index = 0;
			}
			while(index >= line.length())
			{
				line = readLine();
				index = 0;
			}
			while(Character.isWhitespace(line.charAt(index)))
			{
				index++;
				while(index >= line.length())
				{
					line = readLine();
					index = 0;
				}
			}
			int endIndex = index;
			while(endIndex < line.length() && !Character.isWhitespace(line.charAt(endIndex)))
				endIndex++;
			String s = line.substring(index, endIndex);
			index = endIndex;
			return s;
		}
		public int nextInt() { return Integer.parseInt(next()); }
		public long nextLong() { return Long.parseLong(next()); }
		public double nextDouble() { return Double.parseDouble(next()); }
		public void close() {;}
	}
}


import java.util.*;
import java.io.*;
/*
1
F 1 E 8

1
E 2 E 3

27c 40c 200c 0c 0c
1100c 100c 0c 0c 210c

1677
 */
public class eight
{
	public static void main(String[] arg) throws IOException
	{
		new eight();
	}
	public eight() throws IOException
	{
		FastInput in = new FastInput(System.in);
		PrintWriter out = new PrintWriter(System.out);
		int n = in.nextInt();
		int m = in.nextInt();
		String str = in.next();
		char[] arr = str.toCharArray();
		int periods = 0;
		int groups = 0;
		for(int i = 0; i < str.length(); i++)
		{
			if(str.charAt(i) == '.') periods++;
			else if(i != 0 && str.charAt(i-1) == '.') groups++;
		}
		if(str.charAt(m-1) == '.') groups++;

		for(int i = 0; i < m; i++)
		{
			int index = in.nextInt()-1;
			char ch = in.nextChar();
			if(ch == '.')
			{
				if(arr[index] != '.') periods++;
				if(index == 0 || index == str.length()-1)
				{
					if(arr[index] != '.')
					{
						if(m == 1 && arr[index] != '.') groups++;
						if(m >= 2)
						{
							if(index == 0)
							{
								if(arr[index+1] != '.') groups++;
							}
							else
							{
								if(arr[index-1] != '.') groups++;
							}
						}
					}
				}
				else
				{
					if(arr[index-1] != '.' && arr[index+1] != '.') groups++;
					if(arr[index-1] == '.' && arr[index+1] == '.') groups--;
				}
			}
			else
			{
				if(arr[index] == '.') periods--;
				if(index == 0 || index == str.length()-1)
				{
					if(arr[index] == '.')
					{
						if(m >= 2)
						{
							if(index == 0)
							{
								if(arr[index+1] != '.') groups--;
							}
							else
							{
								if(arr[index-1] != '.') groups--;
							}
						}
					}
				}
				else
				{
					if(arr[index-1] == '.' && arr[index+1] == '.') groups++;
				}
			}
			arr[index] = ch;
			out.println(periods-groups);
		}
		in.close(); out.close();
	}

	class FastInput
	{
		BufferedReader reader;
		StringTokenizer tokenizer;

		public FastInput(InputStream input)
		{
			reader = new BufferedReader(new InputStreamReader(input));
			tokenizer = new StringTokenizer("");
		}
		String next() throws IOException
		{
			while( ! tokenizer.hasMoreTokens() )
			{
				tokenizer = new StringTokenizer(reader.readLine());
			}
			return tokenizer.nextToken();
		}
		char nextChar() throws IOException { return next().charAt(0); }
		int nextInt() throws IOException { return Integer.parseInt(next()); }
		double nextDouble() throws IOException { return Double.parseDouble(next()); }
		long nextLong() throws IOException { return Long.parseLong(next()); }
		void close() throws IOException { reader.close(); }
	}
}


import java.util.*;
import java.io.*;
/*
1
F 1 E 8

1
E 2 E 3

27c 40c 200c 0c 0c
1100c 100c 0c 0c 210c

1677
 */
public class eight
{
	public static void main(String[] arg) throws IOException
	{
		new eight();
	}
	public eight() throws IOException
	{
		FastInput in = new FastInput(System.in);
		PrintWriter out = new PrintWriter(System.out);
		int n = in.nextInt();
		int m = in.nextInt();
		String str = in.next();
		char[] arr = str.toCharArray();
		int periods = 0;
		int groups = 0;
		for(int i = 0; i < str.length(); i++)
		{
			if(str.charAt(i) == '.') periods++;
			else if(i != 0 && str.charAt(i-1) == '.') groups++;
		}
		if(n >= 2 && str.charAt(arr.length-1) == '.' && str.charAt(n-2) != '.') groups++;
		for(int i = 0; i < m; i++)
		{
			int index = in.nextInt()-1;
			char ch = in.nextChar();
			if(ch == '.')
			{
				if(arr[index] != '.') periods++;
				if(index == 0 || index == str.length()-1)
				{
					if(arr[index] != '.')
					{
						if(m == 1 && arr[index] != '.') groups++;
						if(m >= 2)
						{
							if(index == 0)
							{
								if(arr[index+1] != '.') groups++;
							}
							else
							{
								if(arr[index-1] != '.') groups++;
							}
						}
					}
				}
				else
				{
					if(arr[index-1] != '.' && arr[index+1] != '.') groups++;
					if(arr[index-1] == '.' && arr[index+1] == '.') groups--;
				}
			}
			else
			{
				if(arr[index] == '.') periods--;
				if(index == 0 || index == str.length()-1)
				{
					if(arr[index] == '.')
					{
						if(m >= 2)
						{
							if(index == 0)
							{
								if(arr[index+1] != '.') groups--;
							}
							else
							{
								if(arr[index-1] != '.') groups--;
							}
						}
					}
				}
				else
				{
					if(arr[index-1] == '.' && arr[index+1] == '.') groups++;
				}
			}
			arr[index] = ch;
			out.println(periods-groups);
		}
		in.close(); out.close();
	}

	class FastInput
	{
		BufferedReader reader;
		StringTokenizer tokenizer;

		public FastInput(InputStream input)
		{
			reader = new BufferedReader(new InputStreamReader(input));
			tokenizer = new StringTokenizer("");
		}
		String next() throws IOException
		{
			while( ! tokenizer.hasMoreTokens() )
			{
				tokenizer = new StringTokenizer(reader.readLine());
			}
			return tokenizer.nextToken();
		}
		char nextChar() throws IOException { return next().charAt(0); }
		int nextInt() throws IOException { return Integer.parseInt(next()); }
		double nextDouble() throws IOException { return Double.parseDouble(next()); }
		long nextLong() throws IOException { return Long.parseLong(next()); }
		void close() throws IOException { reader.close(); }
	}
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.InputStreamReader;
import java.io.FileNotFoundException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Replacement solver = new Replacement();
        solver.solve(1, in, out);
        out.close();
    }

    static class Replacement {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int m = in.nextInt();
            char[] str = in.nextLine().toCharArray();
            int tot = 0;
            int c = 0;
            for (int i = 0; i < n; i++) {
                if (str[i] == '.') {
                    c++;
                    if (i == n - 1) {
                        tot += (c - 1);
                    }
                } else {
                    if (c >= 2) {
                        tot += (c - 1);
                    }
                    c = 0;
                }
            }

            while (m-- > 0) {
                int x = in.nextInt() - 1;
                char rep = in.next().toCharArray()[0];
                if (n == 1) {
                    out.println(0);
                    continue;
                } else if (rep == '.') {
                    if (str[x] != '.') {
                        if (x == 0) {
                            if (str[x + 1] == '.') {
                                tot++;
                            }
                        } else if (x == n - 1) {
                            if (str[x - 1] == '.') {
                                tot++;
                            }
                        } else {
                            if (str[x - 1] == '.' && str[x + 1] == '.') {
                                tot += 2;
                            } else if (str[x - 1] == '.' || str[x + 1] == '.') {
                                tot++;
                            }
                        }
                    }
                } else {
                    if (x == 0) {
                        if (str[x] == '.' && str[x + 1] == '.') {
                            tot--;
                        }
                    } else if (x == n - 1) {
                        if (str[x] == '.' && str[x - 1] == '.') {
                            tot--;
                        }
                    } else {
                        if (str[x] == '.' && str[x - 1] == '.' && str[x + 1] == '.') {
                            tot -= 2;
                        } else if (str[x] == '.' && str[x + 1] == '.') {
                            tot--;
                        } else if (str[x] == '.' && str[x - 1] == '.') {
                            tot--;
                        }
                    }
                }
                str[x] = rep;
                out.println(tot);
            }
        }

    }

    static class Scanner {
        StringTokenizer st;
        BufferedReader br;

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

        public Scanner(String s) {
            try {
                br = new BufferedReader(new FileReader(s));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

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

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

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

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.InputStreamReader;
import java.io.FileNotFoundException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Replacement solver = new Replacement();
        solver.solve(1, in, out);
        out.close();
    }

    static class Replacement {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int m = in.nextInt();
            char[] str = in.nextLine().toCharArray();
            int tot = 0;
            int c = 0;
            for (int i = 0; i < n; i++) {
                if (str[i] == '.') {
                    c++;
                    if (i == n - 1) {
                        tot += (c - 1);
                    }
                } else {
                    if (c >= 2) {
                        tot += (c - 1);
                    }
                    c = 0;
                }
            }

            while (m-- > 0) {
                int x = in.nextInt() - 1;
                char rep = in.next().toCharArray()[0];
                if (n == 1) {
                    out.println(0);
                    break;
                } else if (rep == '.') {
                    if (str[x] != '.') {
                        if (x == 0) {
                            if (str[x + 1] == '.') {
                                tot++;
                            }
                        } else if (x == n - 1) {
                            if (str[x - 1] == '.') {
                                tot++;
                            }
                        } else {
                            if (str[x - 1] == '.' && str[x + 1] == '.') {
                                tot += 2;
                            } else if (str[x - 1] == '.' || str[x + 1] == '.') {
                                tot++;
                            }
                        }
                    }
                } else {
                    if (x == 0) {
                        if (str[x] == '.' && str[x + 1] == '.') {
                            tot--;
                        }
                    } else if (x == n - 1) {
                        if (str[x] == '.' && str[x - 1] == '.') {
                            tot--;
                        }
                    } else {
                        if (str[x] == '.' && str[x - 1] == '.' && str[x + 1] == '.') {
                            tot -= 2;
                        } else if (str[x] == '.' && str[x + 1] == '.') {
                            tot--;
                        } else if (str[x] == '.' && str[x - 1] == '.') {
                            tot--;
                        }
                    }
                }
                str[x] = rep;
                out.println(tot);
            }
        }

    }

    static class Scanner {
        StringTokenizer st;
        BufferedReader br;

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

        public Scanner(String s) {
            try {
                br = new BufferedReader(new FileReader(s));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

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

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

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

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.InputStreamReader;
import java.io.FileNotFoundException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Replacement solver = new Replacement();
        solver.solve(1, in, out);
        out.close();
    }

    static class Replacement {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int m = in.nextInt();
            char[] str = in.nextLine().toCharArray();
            int tot = 0;
            int c = 0;
            for (int i = 0; i < n; i++) {
                if (str[i] == '.') {
                    c++;
                    if (i == n - 1) {
                        tot += (c - 1);
                    }
                } else {
                    if (c >= 2) {
                        tot += (c - 1);
                    }
                    c = 0;
                }
            }

            while (m-- > 0) {
                int x = in.nextInt() - 1;
                char rep = in.next().toCharArray()[0];
                if (rep == '.') {
                    if (str[x] != '.') {
                        if (x == 0) {
                            if (str[x + 1] == '.') {
                                tot++;
                            }
                        } else if (x == n - 1) {
                            if (str[x - 1] == '.') {
                                tot++;
                            }
                        } else {
                            if (str[x - 1] == '.' && str[x + 1] == '.') {
                                tot += 2;
                            } else if (str[x - 1] == '.' || str[x + 1] == '.') {
                                tot++;
                            }
                        }
                    }
                } else {
                    if (x == 0) {
                        if (str[x] == '.' && str[x + 1] == '.') {
                            tot--;
                        }
                    } else if (x == n - 1) {
                        if (str[x] == '.' && str[x - 1] == '.') {
                            tot--;
                        }
                    } else {
                        if (str[x] == '.' && str[x - 1] == '.' && str[x + 1] == '.') {
                            tot -= 2;
                        } else if (str[x] == '.' && str[x + 1] == '.') {
                            tot--;
                        } else if (str[x] == '.' && str[x - 1] == '.') {
                            tot--;
                        }
                    }
                }
                str[x] = rep;
                out.println(tot);
            }
        }

    }

    static class Scanner {
        StringTokenizer st;
        BufferedReader br;

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

        public Scanner(String s) {
            try {
                br = new BufferedReader(new FileReader(s));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

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

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

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

    }
}


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();
                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));
                            segstart.add(fr.l);
                            seg.remove(bs);
                            seg.remove(bs - 1);
                            segstart.remove(bs);
                            segstart.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));
                            segstart.add(sc.l);
                            initans -= (sc.r - sc.l);
                            initans += (ind - sc.l);
                            seg.remove(bs - 1);
                            segstart.remove(bs - 1);
                        }
                        else if(sc.l - 1 == ind){
                            found = true;
                            seg.add(new Segment(ind, sc.r));
                            segstart.add(ind);
                            seg.remove(bs - 1);
                            segstart.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){
                            found = true;
                            seg.add(new Segment(sc.l, ind));
                            segstart.add(sc.l);
                            initans -= (sc.r - sc.l);
                            seg.remove(bs);
                            segstart.remove(bs);
                            initans += (ind - sc.l);
                        }
                        else if(sc.l - 1 == ind){
                            found = true;
                            seg.add(new Segment(ind, sc.r));
                            segstart.add(ind);
                            seg.remove(bs);
                            segstart.remove(bs);
                            initans -= (sc.r - sc.l);
                            initans += (sc.r - ind);
                        }
                    }
                    if(!found && s[ind] != '.'){
                        seg.add(new Segment(ind, ind));
                        segstart.add(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));
                                segstart.add(sc.l);
                                initans += (ind - 1 - sc.l);
                            }
                            if(ind + 1 <= sc.r){
                                seg.add(new Segment(ind + 1, sc.r));
                                segstart.add(ind + 1);
                                initans += (sc.r - ind - 1);
                            }
                            seg.remove(bs - 1);
                            segstart.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));
                                segstart.add(sc.l);
                                initans += (ind - 1 - sc.l);
                            }
                            if(ind + 1 <= sc.r){
                                seg.add(new Segment(ind + 1, sc.r));
                                segstart.add(ind + 1);
                                initans += (sc.r - ind - 1);
                            }
                            seg.remove(bs);
                            segstart.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);
                        }
                        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);
                            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);
                        }
                    }
                }
                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 car[] = (in.readLine()).toCharArray();
            int ar[] = new int[n];
            for (int i = 0; i < n; i++) {
                ar[i] = car[i] == '.' ? 1 : 0;
            }
            SegmentTree st = new SegmentTree(ar);
            for (int i = 0; i < m; i++) {
                int ind = in.readInt() - 1;
                char c = in.readCharacter();
                st.update(ind, c);
                out.write(Integer.toString(st.root.sum));
                out.newLine();
            }
            out.close();
        }
        catch (Exception e){
            e.printStackTrace();
        }
    }
}
class SegmentTree{
    public SegmentTreeNode root = null;
    public SegmentTree(int a[]){
        root = buildTree(root, 0, a.length - 1, a);
    }
    public SegmentTreeNode buildTree(SegmentTreeNode n, int l, int r, int ar[]){
        if(l > r)
            return null;
        n = new SegmentTreeNode(l, r);
        if(l == r){
            n.pre = ar[l];
            n.suf = ar[l];
            n.sum = 0;
        }
        else{
            int mid = (l + r) >> 1;
            n.left = buildTree(n.left, l, mid, ar);
            n.right = buildTree(n.right, mid + 1, r, ar);
            n.sum = n.left.sum + n.right.sum + (n.left.suf == 1 && n.right.pre == 1 ? 1 : 0);
            n.pre = n.left.pre;
            n.suf = n.right.suf;
        }
        return n;
    }
    public void update(int ind, char c){
        if(c == '.')
            updateTree(root, ind, 1);
        else
            updateTree(root, ind, 0);

    }
    public void updateTree(SegmentTreeNode n, int ind, int val){
        if(n.r < ind || n.l > ind)
            return;
        if(n.l >= ind && n.r <= ind){
            n.pre = val;
            n.suf = val;
            return;
        }
        updateTree(n.left, ind, val);
        updateTree(n.right, ind, val);
        n.sum = n.left.sum + n.right.sum + (n.left.suf == 1 && n.right.pre == 1 ? 1 : 0);
        n.pre = n.left.pre;
        n.suf = n.right.suf;
    }
}
class SegmentTreeNode{
    int l, r;
    public int pre, suf, sum;
    SegmentTreeNode left, right;
    public SegmentTreeNode(int l, int r){
        this.l = l;
        this.r = 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);
                }
//                System.out.println("Segment");
//                for (Segment sg : seg) {
//                    System.out.println(sg);
//                }
//                System.out.println("End segment");
//                System.out.println(c+" "+ind);
                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){
                            found = true;
                            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){
                            found = true;
                            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);
                        }
                    }
                    if(!found){
                        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();
                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;
    }
}