#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main(void) {
  ll n;
  string s;
  cin >> n >> s;
  ll white_num = 0, black_num = 0, ret = n;
  ll tmp = 0;
  for (ll i = 0; i < n; i++) {
    if (i % 1000 == 0) {
      cout << i;
    }
    if (s[i] == '.') white_num++;
  }
  for (ll i = 0; i < n; i++) {
    if (s[i] == '.') {
      white_num--;
    }
    if (s[i] == '#') {
      black_num++;
    }
    ret = min(ret, white_num + black_num);
  }
  cout << ret << endl;
  return 0;
}
