#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n;
  cin >> s;
  int count = 0;
  string check = s;
  for (int i = 0; i < n - 1; i++) {
    if (check[i] == '#' && check[i + 1] == '.') {
      count += 1;
      check[i + 1] = '#';
    }
  }
  int count2 = 0;
  for (int i = n - 1; i > 0; i--) {
    if (s[i] == '#' && s[i + 1] == '.') {
      count2 += 1;
      s[i] = '.';
    }
  }
  if (count > count2)
    cout << count2 << endl;
  else
    cout << count << endl;
}
