#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int N;
  cin >> N;
  string s;
  s.reserve(N);
  cin >> s;
  int counter = 0;
  int i = 0;
  for (i = 0; i < N - 1; ++i) {
    if (s[i] == '#' && s[i + 1] == '.') {
      s[i + 1] = '#';
      ++counter;
    }
  }
  if (s[i] == '#' && s[i + 1] == '.') {
    ++counter;
  }
  cout << counter << "\n" << endl;
}
