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 CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
using lld = int64_t;
class S {
 public:
  set<pair<int, int>>::iterator find_nearest_interval(set<pair<int, int>> &Q,
                                                      int idx) {
    auto itr = Q.lower_bound({idx, idx});
    if (itr != Q.end()) {
      if (itr->first <= idx && idx <= itr->second) {
        return itr;
      }
    }
    if (itr != Q.begin()) {
      --itr;
      if (itr->first <= idx && idx <= itr->second) {
        return itr;
      }
    }
    return itr;
  }
  set<pair<int, int>>::iterator insert_period(set<pair<int, int>> &Q, int idx,
                                              lld *subtract1) {
    auto find_int = find_nearest_interval(Q, idx);
    if (find_int != Q.end() && find_int->first <= idx &&
        idx <= find_int->second) {
      return Q.end();
    }
    auto int_itr_pair = Q.insert({idx, idx});
    auto int_itr = int_itr_pair.first;
    bool should_merge_left = false;
    bool should_merge_right = false;
    auto int_itr_prev = int_itr;
    auto int_itr_next = int_itr;
    if (int_itr != Q.begin()) {
      --int_itr_prev;
      if (int_itr->first - 1 == int_itr_prev->second) {
        should_merge_left = true;
      }
    }
    if (int_itr != Q.end()) {
      ++int_itr_next;
      if (int_itr_next != Q.end() &&
          int_itr->second + 1 == int_itr_next->first) {
        should_merge_right = true;
      }
    }
    if (should_merge_left && should_merge_right) {
      *subtract1 = calc_ops(*int_itr_prev) + calc_ops(*int_itr_next);
      int start = int_itr_prev->first;
      int end = int_itr_next->second;
      Q.erase(int_itr_prev);
      Q.erase(int_itr_next);
      Q.erase(int_itr);
      auto new_int_pair = Q.insert({start, end});
      return new_int_pair.first;
    } else if (should_merge_left) {
      *subtract1 = calc_ops(*int_itr_prev);
      int start = int_itr_prev->first;
      int end = idx;
      Q.erase(int_itr_prev);
      Q.erase(int_itr);
      auto new_int_pair = Q.insert({start, end});
      return new_int_pair.first;
    } else if (should_merge_right) {
      *subtract1 = calc_ops(*int_itr_next);
      int start = idx;
      int end = int_itr_next->second;
      Q.erase(int_itr);
      Q.erase(int_itr_next);
      auto new_int_pair = Q.insert({start, end});
      return new_int_pair.first;
    }
    return int_itr;
  }
  lld calc_ops(const pair<int, int> &p) {
    int start = p.first;
    int end = p.second;
    double n = end - start + 1;
    lld res = 0;
    while (n > 1) {
      res += n / 2;
      n = ceil(n / 2);
    }
    return res;
  }
  void form_intervals(const string &s, set<pair<int, int>> &intervals) {
    int len = s.length();
    int start = 0, end = start;
    while (end < len) {
      end = start;
      while (end < len && s[end] == '.') {
        ++end;
      }
      if (end > start) {
        intervals.insert({start, end - 1});
      }
      while (end < len && s[end] != '.') {
        ++end;
      }
      start = end;
    }
  }
  void solve(string &s, vector<pair<int, char>> &queries) {
    int n = queries.size();
    set<pair<int, int>> intervals;
    form_intervals(s, intervals);
    lld res = 0;
    for (const pair<int, int> &p : intervals) {
      lld tmp = calc_ops(p);
      res += tmp;
    }
    for (int i = 0; i < n; ++i) {
      int idx = queries[i].first;
      char c = queries[i].second;
      if (c == '.') {
        lld subtract1 = 0;
        set<pair<int, int>>::iterator nearest_int_itr =
            insert_period(intervals, idx, &subtract1);
        if (nearest_int_itr != intervals.end()) {
          lld add1 = calc_ops(*nearest_int_itr);
          res -= subtract1;
          res += add1;
        }
      } else {
        set<pair<int, int>>::iterator nearest_int_itr =
            find_nearest_interval(intervals, idx);
        if (nearest_int_itr != intervals.end()) {
          pair<int, int> tmp_int = *nearest_int_itr;
          if (tmp_int.first <= idx && idx <= tmp_int.second) {
            intervals.erase(nearest_int_itr);
            lld subtract1 = calc_ops(tmp_int);
            res -= subtract1;
            if (tmp_int.first <= idx - 1) {
              pair<int, int> tmp_int2 = {tmp_int.first, idx - 1};
              lld add1 = calc_ops(tmp_int2);
              res += add1;
              intervals.insert(tmp_int2);
            }
            if (idx + 1 <= tmp_int.second) {
              pair<int, int> tmp_int3 = {idx + 1, tmp_int.second};
              lld add2 = calc_ops(tmp_int3);
              res += add2;
              intervals.insert(tmp_int3);
            }
          }
        }
      }
      cout << res << endl;
    }
  }
  void brute_force(string s, const vector<pair<int, char>> &q) {
    int n = q.size();
    for (int i = 0; i < n; ++i) {
      s[q[i].first] = q[i].second;
      set<pair<int, int>> intervals;
      form_intervals(s, intervals);
      lld res = 0;
      for (auto &p : intervals) {
        lld tmp = calc_ops(p);
        res += tmp;
      }
      cout << res << endl;
    }
  }
  void solve() {
    int n, m;
    string s;
    vector<pair<int, char>> q;
    cin >> n >> m >> s;
    int a;
    char c;
    for (int i = 0; i < m; ++i) {
      cin >> a >> c;
      q.push_back({a - 1, c});
    }
    solve(s, q);
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  S s;
  s.solve();
  return 0;
}