#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, hantei;
  string s;
  int ans;
  int count1 = 0, count2 = 0;
  cin >> n;
  char c[n + 1];
  cin >> s;
  s.copy(c, s.size());
  do {
    hantei = 0;
    for (int i = 0; i < n - 1; i++) {
      if (s[i] == '#' && s[i + 1] == '.') {
        s[i + 1] = '#';
        count1++;
        hantei++;
      }
    }
  } while (hantei);
  do {
    hantei = 0;
    for (int i = 0; i < n - 1; i++) {
      if (c[i] == '#' && c[i + 1] == '.') {
        c[i] = '.';
        count2++;
        hantei++;
      }
    }
  } while (hantei);
  ans = min(count1, count2);
  cout << ans << endl;
  return (0);
}
