#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s[2];
  cin >> n >> s[0];
  s[1] = s[0];
  int count[2] = {0, 0};
  int i = 0;
  while (i != s[0].size() - 2) {
    for (int j = 0; j < n - 1; j++) {
      if (s[0][j] == '#' && s[0][j + 1] == '.') {
        s[0][j] = '.';
        count[0]++;
        break;
      }
    }
    i++;
  }
  i = 0;
  while (i != s[1].size() - 2) {
    for (int j = 0; j < n - 1; j++) {
      if (s[1][j] == '#' && s[1][j + 1] == '.') {
        s[1][j + 1] = '#';
        count[1]++;
        break;
      }
    }
    i++;
  }
  cout << min(count[0], count[1]) << endl;
  return 0;
}
