#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  string t = s;
  int tmp1 = 0;
  vector<int> a(n, 0), b(n, 0);
  for (int i = 0; i < n - 1; i++) {
    if (s[i] == '#' && s[i + 1] == '.') {
      tmp1++;
      s[i + 1] = '#';
    }
    a[i + 1] = tmp1;
  }
  int tmp2 = 0;
  for (int i = n - 1; i > 0; i--) {
    if (t[i] == '.' && t[i - 1] == '#') {
      tmp2++;
      t[i - 1] = '.';
    }
    b[n - i] = tmp2;
  }
  reverse(b.begin(), b.end());
  int ans = n;
  for (int i = 1; i < n - 1; i++) {
    if (!(s[i] == '#' && t[i + 1] == '.')) {
      ans = min(a[i] + b[i], ans);
    }
  }
  ans = min(ans, tmp1);
  ans = min(ans, tmp2);
  cout << ans << endl;
}
