#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  long long res = 0;
  long long b[n], w[n];
  memset(b, 0, sizeof(b));
  memset(w, 0, sizeof(w));
  long long bj = 0, wj = 0;
  for (long long i = 0; i < n; i++) {
    if (s[i] == '.') wj++;
    if (s[i] == '#') bj++;
  }
  res = min(bj, wj);
  long long cnt = wj;
  res = cnt;
  for (long long i = 0; i < n; i++) {
    if (s[i] == '#') {
      cnt++;
      ;
    } else {
      cnt--;
    }
  }
  res = min(cnt, res);
  cout << res << endl;
}
