#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  string cops;
  cops = s;
  int cost;
  cost = 0;
  int i;
  i = 0;
  char s1 = '#';
  char s2 = '.';
  int penalty;
  penalty = 0;
  bool ans;
  ans = true;
  while (i < n) {
    if (s[i] == s2) {
      cost += 1;
    }
    i += 1;
  }
  i = 0;
  if (s[0] != s1) {
    while (ans) {
      if (s[i] != s1) {
        penalty += 1;
      } else {
        ans = false;
      }
      i += 1;
      if (i == n) {
        ans = false;
      }
    }
  }
  int answer;
  answer = cost - penalty;
  cout << answer << endl;
}
