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