#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int mx = 0;
  int ind;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      char p = s[i];
      int cnt = 0;
      int index = i;
      while (s[i] == p) {
        i++;
        cnt++;
      }
      if (mx < cnt) {
        mx = cnt;
        ind = index;
      }
    }
  }
  int ans = 0;
  for (int i = 0; i < n; i++) {
    while (i < ind) {
      if (s[i] == '#') {
        ans++;
      }
      i++;
    }
    if (s[i] == '.') ans++;
  }
  int ans2 = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') ans2++;
  }
  int ans1 = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      while (i < n) {
        if (s[i] == '.') ans1++;
        i++;
      }
    }
  }
  cout << min(ans, min(ans1, ans2)) << endl;
}
