#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, ans = 0, rans = 0;
  char c;
  string s;
  cin >> n >> s;
  c = s[0];
  for (int i = 0; i < n - 1; i++) {
    if (c == '#' && s[i + 1] == '.') {
      ans++;
      c = '#';
    }
  }
  reverse(s.begin(), s.end());
  c = s[0];
  for (int i = 0; i < n - 1; i++) {
    if (c == '#' && s[i + 1] == '.') {
      rans++;
      c = '#';
    }
  }
  cout << max(ans, rans);
}
