#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  int n;
  cin >> n;
  string s;
  cin >> s;
  const long long INF = 1LL << 60;
  long long cnt_min = INF;
  for (int i = 0; i < n; ++i) {
    int cnt = 0;
    for (int j = 0; j < n; ++j) {
      if (j <= i) {
        if (s[j] == '#') cnt++;
      } else {
        if (s[j] == '.') cnt++;
      }
    }
    if (cnt < cnt_min) cnt_min = cnt;
  }
  cout << cnt_min << endl;
  return 0;
}
