#include <bits/stdc++.h>
using namespace std;
bool arr[200002];
int GCD(int a, int b) {
  if (b == 0) return a;
  return GCD(b, a % b);
}
int main() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  string a;
  cin >> n >> a;
  int flip = 0;
  for (int i = 0; i < n; ++i) {
    if (a[i] == '#') {
      arr[i] = 1;
    } else if (i > 0) {
      if (arr[i - 1] == true) {
        ++flip;
        arr[i] = 1;
      }
    }
  }
  cout << flip;
  return 0;
}
