#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  cin >> n;
  string stone;
  cin >> stone;
  int count_white = 0;
  int count_black = 0;
  for (int i = 0; i < n - 2; i++) {
    if (stone[i] == '.')
      count_white++;
    else
      count_black++;
  }
  if (count_white < count_black && stone[n - 1] == '.')
    cout << count_white + 1 << endl;
  if (count_white < count_black && stone[n - 1] == '#')
    cout << count_white << endl;
  else
    cout << count_black << endl;
  return 0;
}
