#include <bits/stdc++.h>
int main(void) {
  int n;
  std::cin >> n;
  char s[n];
  std::cin >> s;
  char sa[n];
  for (int i = 0; i < n; i++) {
    sa[i] = s[i];
  }
  int counter1 = 0;
  for (int i = 0; i < n - 1; i++) {
    if (s[i] == '#' && s[i + 1] == '.') {
      s[i + 1] = '#';
      counter1++;
    }
  }
  int counter2 = 0;
  for (int i = n - 1; i > 0; i--) {
    if (sa[i] == '.' && sa[i - 1] == '#') {
      s[i - 1] = '.';
      counter2++;
    }
  }
  if (counter2 > counter1) {
    std::cout << counter1;
  } else {
    std::cout << counter2;
  }
  return 0;
}
