#include <bits/stdc++.h>
using namespace std;
int n;
string s;
int solve() {
  int ans1{}, ans2{};
  bool check1 = false, check2 = false;
  for (size_t i = 0; i < s.size(); ++i) {
    if (s[i] == '.') {
      if (check1) ++ans1;
      check1 = true;
    }
  }
  for (size_t i = 0; i < s.size(); ++i) {
    if (s[i] == '#') {
      if (check2) ++ans2;
      check2 = true;
    }
  }
  if (check1 && check2) return max(ans1, ans2);
  return 0;
}
int main() {
  cin >> n >> s;
  cout << solve() << endl;
}
