#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  string s;
  std::cin >> n >> s;
  int a = 0, b = 0;
  int black = 0, white = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      black++;
    } else {
      white++;
    }
  }
  a = n - black;
  b = n - white;
  if (s[1] == '.' && b > 0) b--;
  std::cout << min(a, b) << std::endl;
}
