#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int INF = 1 << 30;
const int MOD = 1e9 + 7;
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  string s;
  cin >> s;
  int ans = INF;
  for (int i = 0; i <= s.size(); i++) {
    int black = 0;
    for (int j = 0; j < i; j++) {
      if (s[j] == '#') black++;
    }
    int white = 0;
    for (int j = i; j < s.size(); j++) {
      if (s[j] == '.') white++;
    }
    ans = min(ans, black + white);
  }
  cout << ans << endl;
  return 0;
}
