#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int a[N];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int n;
  bool ok = false, flag = false;
  string s;
  cin >> n >> s;
  int cnt1 = 0, cnt2 = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      cnt1++;
      flag = true;
      if (i == n - 1) {
        ok = true;
      }
    } else {
      cnt2++;
    }
  }
  int c1 = 0, c2 = 0;
  if (!ok && flag) {
    int j = n - 1;
    while (s[j] == '.') {
      c1++;
      j--;
    }
    j--;
    while (s[j] == '#') {
      c2++;
      j--;
    }
    cout << min(cnt1, min(cnt2, cnt1 - c2 + c1));
    return 0;
  }
  cout << min(cnt1 - ok, cnt2);
  return 0;
}
