Problem: Daniel has a string s, consisting of lowercase English letters and period signs (characters '.'). Let's define the operation of replacement as the following sequence of steps: find a substring ".." (two consecutive periods) in string s, of all occurrences of the substring let's choose the first one, and replace this substring with string ".". In other words, during the replacement operation, the first two consecutive periods are replaced by one. If string s contains no two consecutive periods, then nothing happens.

Let's define f(s) as the minimum number of operations of replacement to perform, so that the string does not have any two consecutive periods left.

You need to process m queries, the i-th results in that the character at position xi (1 ≤ xi ≤ n) of string s is assigned value ci. After each operation you have to calculate and output the value of f(s).

Help Daniel to process all queries.

Input

The first line contains two integers n and m (1 ≤ n, m ≤ 300 000) the length of the string and the number of queries.

The second line contains string s, consisting of n lowercase English letters and period signs.

The following m lines contain the descriptions of queries. The i-th line contains integer xi and ci (1 ≤ xi ≤ n, ci — a lowercas English letter or a period sign), describing the query of assigning symbol ci to position xi.

Output

Print m numbers, one per line, the i-th of these numbers must be equal to the value of f(s) after performing the i-th assignment.

Examples

Input

10 3
.b..bz....
1 h
3 c
9 f


Output

4
3
1


Input

4 4
.cc.
2 .
3 .
2 a
1 a


Output

1
3
1
1

Note

Note to the first sample test (replaced periods are enclosed in square brackets).

The original string is ".b..bz....".

  * after the first query f(hb..bz....) = 4 ("hb[..]bz...."  →  "hb.bz[..].."  →  "hb.bz[..]."  →  "hb.bz[..]"  →  "hb.bz.")
  * after the second query f(hbс.bz....) = 3 ("hbс.bz[..].."  →  "hbс.bz[..]."  →  "hbс.bz[..]"  →  "hbс.bz.")
  * after the third query f(hbс.bz..f.) = 1 ("hbс.bz[..]f."  →  "hbс.bz.f.")



Note to the second sample test.

The original string is ".cc.".

  * after the first query: f(..c.) = 1 ("[..]c."  →  ".c.")
  * after the second query: f(....) = 3 ("[..].."  →  "[..]."  →  "[..]"  →  ".")
  * after the third query: f(.a..) = 1 (".a[..]"  →  ".a.")
  * after the fourth query: f(aa..) = 1 ("aa[..]"  →  "aa.")

Solution (in JAVA):

Solution:
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Scanner;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.TreeSet;
import java.util.concurrent.PriorityBlockingQueue;

public class aa {
	public static class node implements Comparable<node> {
		int val;
		long num;

		node(int a, long b) {
			val = a;
			num = b;
		}

		@Override
		public int compareTo(node o) {
			if (o.num < num)
				return 1;
			else if (o.num > num)
				return -1;
			return 0;
		}

	}

	public static long treeLeft[];
	public static long treeRight[];
	public static long lazyLeft[];
	public static long lazyRight[];

	public static void build(int s, int e, int p, long tree[], int a[]) {
		if (s == e) {
			tree[p] = a[s];
			return;
		}

		int mid = (s + e) / 2;

		build(s, mid, p * 2, tree, a);
		build(mid + 1, e, p * 2 + 1, tree, a);
		tree[p] = tree[p * 2] + tree[p * 2 + 1];

	}

	public static void remove(int s, int e, int p, int idx, long tree[]) {
		if (s > idx || idx > e)
			return;

		if (s == e) {
			tree[p] = 0;
			return;
		}
		int mid = (s + e) / 2;

		remove(s, mid, p * 2, idx, tree);
		remove(mid + 1, e, p * 2 + 1, idx, tree);
		tree[p] = tree[p * 2] + tree[p * 2 + 1];

	}

	public static void update(int s, int e, int p, int from, int to,
			long tree[], long lazy[], long val) {
		if (lazy[p] != 0) {
			tree[p] += lazy[p];
			if (s != e) {
				lazy[p * 2] += lazy[p];
				lazy[p * 2 + 1] += lazy[p];
			}
			lazy[p] = 0;
		}
		if (s > to || e < from)
			return;
		if (s >= from && e <= to) {

			tree[p] += val;
			if (s != e) {
				lazy[p * 2] += val;
				lazy[p * 2 + 1] += val;
			}

			return;
		}

		int mid = (s + e) / 2;

		update(s, mid, p * 2, from, to, tree, lazy, val);
		update(mid + 1, e, p * 2 + 1, from, to, tree, lazy, val);
		tree[p] = tree[p * 2] + tree[p * 2 + 1];

	}

	public static long get(int s, int e, int p, int from, int to, long tree[],
			long lazy[]) {
		if (lazy[p] != 0) {
			tree[p] += lazy[p];
			if (s != e) {
				lazy[p * 2] += lazy[p];
				lazy[p * 2 + 1] += lazy[p];
			}
			lazy[p] = 0;
		}
		if (s > to || e < from)
			return 0;
		if (s >= from && e <= to) {
			return tree[p];

		}

		int mid = (s + e) / 2;

		long a = get(s, mid, p * 2, from, to, tree, lazy);
		long b = get(mid + 1, e, p * 2 + 1, from, to, tree, lazy);

		return a + b;
	}

	public static String[] split(String a) {
		int len = a.length() / 2;
		String one = "";
		String two = "";
		for (int i = 0; i < len; i++) {
			one += a.charAt(i);
		}
		for (int i = len; i < a.length(); i++) {
			two += a.charAt(i);
		}

		String aa[] = new String[2];
		aa[0] = one;
		aa[1] = two;

		return aa;
	}

	public static int len;
	public static HashMap<String, Boolean> mp = new HashMap();

	public static long gcd(long a, long b) {
		if (b == 0)
			return a;
		return gcd(b, a % b);
	}

	public static long comp(int n, int r) {
		long ans = 1;
		r = Math.min(r, n - r);
		for (int i = 1; i <= r; i++) {
			ans = ans * ((long) n - (long) i + 1L) / (long) i;
		}
		return ans;
	}

	public static long mod = 1000000021;

	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		// BufferedReader in = new BufferedReader(new
		// FileReader("out.txt"));
		StringBuilder q = new StringBuilder();
		PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));

		String y[] = in.readLine().split(" ");
		int n = Integer.parseInt(y[0]);
		int m = Integer.parseInt(y[1]);
		String arr = in.readLine();
		int left[] = new int[n + 2];
		int right[] = new int[n + 2];
		treeLeft = new long[n * 4 + 10];
		treeRight = new long[n * 4 + 10];
		lazyLeft = new long[n * 4 + 10];
		lazyRight = new long[n * 4 + 10];

		char a[] = new char[n + 1];

		for (int i = 1; i <= n; i++)
			a[i] = arr.charAt(i - 1);
		long ans = 0;
		int cont = 0;
		for (int i = 1; i <= n; i++) {
			if (a[i] == '.') {
				left[i] = left[i - 1] + 1;
				cont++;
			} else {
				ans += Math.max(0, cont - 1);
				cont = 0;
				left[i] = 0;
			}
		}
		ans += Math.max(0, cont - 1);

		for (int i = n; i >= 1; i--) {
			if (a[i] == '.')
				right[i] = right[i + 1] + 1;
			else
				right[i] = 0;

		}

		build(1, n, 1, treeLeft, left);
		build(1, n, 1, treeRight, right);

		for (int i = 0; i < m; i++) {
			y = in.readLine().split(" ");
			int idx = Integer.parseInt(y[0]);
			char e = y[1].charAt(0);

			if (e == '.' && a[idx] == '.')
				q.append(ans + "\n");
			else if (e != '.' && a[idx] != '.')
				q.append(ans + "\n");
			else if (e == '.') {
				long l = get(1, n, 1, idx - 1, idx - 1, treeLeft, lazyLeft);
				long r = get(1, n, 1, idx + 1, idx + 1, treeRight, lazyRight);

				ans -= Math.max(l - 1, 0);
				ans -= Math.max(r - 1, 0);
				ans += Math.max(0, l + r);

				update(1, n, 1, (int) idx, (int) (idx + r), treeLeft, lazyLeft,
						l + 1);
				update(1, n, 1, (int) (idx - l), (int) (idx), treeRight,
						lazyRight, r + 1);
				a[idx] = '.';
				q.append(ans + "\n");

			} else {
				long l = get(1, n, 1, idx, idx, treeLeft, lazyLeft);
				long r = get(1, n, 1, idx, idx, treeRight, lazyRight);
				
				ans -= Math.max(0, l + r - 2);
				l--;
				r--;

				ans += Math.max(0, l - 1);
				ans += Math.max(0, r - 1);
				l++;
				r++;

				update(1, n, 1, idx, (int) (idx + r - 1), treeLeft, lazyLeft, l
						* -1);
				update(1, n, 1, (int) (idx - l + 1), idx, treeRight, lazyRight,
						r * -1);

				q.append(ans + "\n");
				a[idx] = e;

			}

			

		}
		System.out.print(q);

		// out.close();
	}
}