#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  string s;
  cin >> s;
  int head;
  int minn = 1e8;
  int dem = 0;
  for (int i = n - 1; i >= 0; --i) {
    head = i;
    head++;
    int ans = 0;
    for (int i = 0; i < head; ++i)
      if (s[i] == '#') ans++;
    minn = min(min(ans, head - ans) + dem, minn);
    dem++;
  }
  cout << minn;
  return 0;
}
