#include <bits/stdc++.h>
using namespace std;
int main() {
  int a;
  cin >> a;
  string str;
  cin >> str;
  int ans = 2147483647, tmp = 0, yes = false;
  for (int i = 0; i < a; i++) {
    if (str[i] == '#') yes = true;
    if (yes && str[i] == '.') tmp++;
  }
  ans = tmp;
  yes = false;
  tmp = 0;
  for (int i = a - 1; i >= 0; i--) {
    if (str[i] == '.') yes = true;
    if (yes && str[i] == '#') tmp++;
  }
  ans = min(ans, tmp);
  cout << ans << '\n';
  return 0;
}
