#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  bool flag = false;
  int id = n - 1;
  int cnt = 0;
  while (id >= 0) {
    if (flag) {
      if (s[id] == '#') ++cnt;
    } else {
      if (s[id] == '.') flag = true;
    }
    --id;
  }
  int ans = cnt;
  cnt = 0, id = 0;
  flag = false;
  while (id < n) {
    if (flag) {
      if (s[id] == '.') ++cnt;
    } else {
      if (s[id] == '#') flag = true;
    }
    ++id;
  }
  ans = min(ans, cnt);
  cout << cnt << endl;
}
