#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int ans = 1e9;
  for (int i = 0; i < (n); ++i) {
    int b = 0, w = 0;
    for (int j = 0; j < (n); ++j) {
      if (j <= i && s[j] == '#') b++;
      if (j > i && s[j] == '.') w++;
    }
    ans = min({ans, b + w});
  }
  cout << ans << endl;
}
