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