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