#include <bits/stdc++.h>
using ll = long long;
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int count, ans = 2e5;
  for (int i = 0; i <= n; i++) {
    count = 0;
    for (int j = 0; j < i; j++)
      if (s.at(j) == '#') count++;
    for (int j = i; j < n; j++)
      if (s.at(j) == '.') count++;
    ans = min(ans, count);
  }
  cout << ans << endl;
  return 0;
}
