#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};
  while (true) {
    int flag = 0;
    for (int i = 0; i < n - 1; i++) {
      if (s[0][i] == '#' && s[0][i + 1] == '.') {
        count[0]++;
        s[0][i] = '.';
        flag = 1;
        i++;
      }
    }
    if (flag == 0) {
      break;
    }
  }
  while (true) {
    int flag = 0;
    for (int i = 0; i < n - 1; i++) {
      if (s[1][i] == '#' && s[1][i + 1] == '.') {
        count[1]++;
        s[1][i + 1] = '#';
        flag = 1;
      }
    }
    if (flag == 0) {
      break;
    }
  }
  cout << min(count[0], count[1]) << endl;
  return 0;
}
