#include <bits/stdc++.h>
using namespace std;
constexpr int MOD = 1000000007;
constexpr int INF = 1050000000;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int j = 0;
  bool f = false;
  while (s[j] == '.') {
    j++;
    f = true;
  }
  if (f) {
    int x = 0, y = 0;
    for (int i = j; i < n; i++) {
      if (s[i] == '#') {
        x++;
      } else {
        y++;
      }
    }
    cout << min(x, y) << endl;
  } else {
    int i = 0;
    while (s[i] == '#') {
      i++;
    }
    int last = i;
    int x = 0, y = 0;
    for (i = last; i < n; i++) {
      if (s[i] == '#') {
        x++;
      } else {
        y++;
      }
    }
    int k = n - 1;
    int g = 0;
    while (s[k] == '#') {
      k--;
      g++;
    }
    cout << min(x + last - g, y) << endl;
  }
}
