#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  vector<char> S;
  vector<char> T;
  for (int i = 0; i < n; i++) {
    S.push_back(s.at(i));
    T.push_back(s.at(i));
  }
  int count_s = 0;
  for (int i = 1; i < n; i++) {
    if (S[i - 1] == '#' && S[i] == '.') {
      S[i] = '#';
      count_s++;
    }
  }
  cout << count_s << endl;
}
