#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, count1 = 0, count2 = 0;
  char s[20000];
  char tmp[20000];
  cin >> n;
  cin >> s;
  memcpy(tmp, s, sizeof(s));
  for (int i = 0; i < n - 1; i++) {
    if (s[i] == '#' && s[i + 1] == '.') {
      s[i + 1] = '#';
      count1++;
    }
  }
  for (int i = n - 1; i >= 0; i--) {
    if (tmp[i] == '.' && tmp[i - 1] == '#') {
      tmp[i] = '.';
      count2++;
    }
  }
  if (count1 < count2)
    cout << count1;
  else
    cout << count2;
}
