#include <bits/stdc++.h>
using namespace std;
const long long INF = 1000000000000000001;
struct edge {
  int to, cost;
};
int dy[] = {0, 0, 1, -1};
int dx[] = {1, -1, 0, 0};
struct Road {
  double cost;
  int a, b;
};
int main() {
  long long n;
  string s;
  long long a = 0;
  cin >> n;
  cin >> s;
  for (int i = 0; i < n - 1; ++i) {
    if (s[i] == '#' && s[i + 1] == '.') a++;
  }
  cout << a << endl;
  return 0;
}
