#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, b = 0, w = 0, ans = 0;
  string s;
  cin >> n;
  cin >> s;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') b++;
    if (s[i] == '.') w++;
  }
  if (b == n || w == n) {
    cout << 0;
    return 0;
  }
  int flagw = 0, flagb = 0, anser = 0;
  int answ = 0, ansb = 0;
  if (s[0] != '.') {
    s[0] = '.';
    anser++;
  }
  if (s[n - 1] != '#') {
    s[n - 1] = '#';
    anser++;
  }
  for (int i = 0; i < n; i++) {
    if (s[i] == '.') {
      if (flagw == 1) answ++;
    } else
      flagw = 1;
  }
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == '#') {
      if (flagb == 1) ansb++;
    } else
      flagb = 1;
  }
  cout << min(ansb, answ) + anser;
  ;
  return 0;
}
