#include <bits/stdc++.h>
using namespace std;
const int c = 300000;
int main() {
  int n, b[c] = {}, w[c] = {}, ans = c;
  string s;
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    int flag = 0;
    if (s[i] == '#') flag++;
    b[i + 1] = b[i] + flag % 2;
    w[i + 1] = w[i] + (flag + 1) % 2;
  }
  reverse(w, w + n + 1);
  for (int i = 0; i <= n; i++) ans = min(ans, b[i] + w[i]);
  cout << ans << endl;
}
