#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  if (n == 1) {
    cout << 0 << endl;
    return 0;
  }
  int cnt1 = 0;
  for (int i = 0; i < n - 1; i++) {
    if (s[i] == '#' && s[i + 1] == '.') {
      cnt1++;
    }
  }
  int cnt2 = 0;
  for (int i = n - 1; i >= 1; i--) {
    if (s[i - 1] == '#' && s[i] == '.') {
      cnt2++;
    }
  }
  int cnt3 = 0, cnt4 = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      cnt3++;
    }
    if (s[i] == '.') {
      cnt4++;
    }
  }
  cout << min({cnt1, cnt2, cnt3, cnt4}) << endl;
  return 0;
}
