#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int count = 0;
  int strSize = s.size();
  int blackCount;
  for (int i = 0; i < strSize; i++) {
    if (s[i] == '#') {
      blackCount++;
    }
  }
  bool isMoreBlack = (blackCount > n);
  for (int i = 0; i < strSize; i++) {
    if (s[i] == '#' && strSize > (i + 1)) {
      if (s[i + 1] == '.') {
        if (isMoreBlack) {
          s[i - 1] = '.';
        } else {
          if (i > 0) {
            s[i + 1] = '#';
          }
        }
        count++;
      }
    }
  }
  cout << count << endl;
  return 0;
}
