#include <bits/stdc++.h>
using namespace std;
const long long INF = 99999999999999;
const int inf = 999999999;
const int maxn = 2e5 + 10;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  bool f = 0;
  int cnt1 = 0, cnt2 = 0;
  char x[maxn];
  cin >> n;
  cin >> x;
  if (x[0] == '#') {
    for (int i = 0; i < n; i++) {
      if (x[i] == '#')
        cnt1++;
      else
        cnt2++;
    }
  } else {
    for (int i = 0; i < n - 1; i++) {
      if (f == 0) {
        if (x[i] != x[i + 1]) {
          f = 1;
          if (x[i + 1] == '.') continue;
        }
      }
      if (f == 1) {
        if (x[i] == '#')
          cnt1++;
        else
          cnt2++;
      }
    }
  }
  cout << min(cnt1, cnt2) << "\n";
  return 0;
}
