#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int cnt = 0, siro[200010], kuro[200010];
  for (int i = 0; i < n; ++i) {
    if (s[i] == '#') ++cnt;
    siro[i + 1] = cnt;
  }
  cnt = 0;
  for (int i = n - 1; i > 0; --i) {
    if (s[i] == '.') ++cnt;
    kuro[i - 1] = cnt;
  }
  int min = 300020;
  for (int i = 0; i < n; ++i) {
    int tmp = siro[i] + kuro[i];
    if (min > tmp) min = tmp;
  }
  cout << min << endl;
}
