#include <bits/stdc++.h>
using namespace std;
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int bc = 0;
  int wc = 0;
  for (unsigned long long i = 0; i < (n); ++i) {
    if (s[i] == '.') wc++;
  }
  int ans = wc + 1;
  for (unsigned long long i = 0; i < (n); ++i) {
    if (s[i] == '#') {
      bc++;
    } else {
      wc--;
    }
    ans = min(ans, bc + wc);
  }
  cout << ans;
}
