#include <bits/stdc++.h>
using namespace std;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int main(void) {
  int n, k;
  string s;
  cin >> n >> k >> s;
  if (n == 1) {
    cout << 0 << endl;
    return 0;
  }
  vector<int> nums;
  if (s[0] == '#') nums.push_back(0);
  for (int i = 0; i < (int)s.size(); i++) {
    int j = i;
    while (j < (int)s.size() && (s[j] == s[i])) ++j;
    nums.push_back(j - i);
    i = j;
  }
  if (s.back() == '.') nums.push_back(0);
  vector<int> sum((int)nums.size() + 1, 0);
  int ans = 0;
  for (int i = 0; i < (int)nums.size(); ++i) sum[i + 1] = sum[i] + nums[i];
  ans = sum[(int)nums.size() - 1];
  ans = min(ans, sum[(int)nums.size() - 1]);
  cout << ans << endl;
  return 0;
}
