#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int ans = INT_MAX;
  int cnt_w = 0, cnt_b = 0;
  for (int i = (0); i < ((n)); i++) {
    int cnt = 0;
    for (int j = (0); j < ((i)); j++) {
      cnt += s[j] == '#';
    }
    for (int j = (i); j < (n); j++) {
      cnt += s[j] == '.';
    }
    ans = min(ans, cnt);
  }
  cout << ans << endl;
}
