#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int black = 0, white = 0, ans = 0;
  int i = 0;
  while (S[i] != '\0') {
    (S[i] == '#') ? black++ : white++;
    i++;
  }
  i = 1;
  while (S[i] != '\0') {
    if (S[i - 1] == '#' && S[i] == '.') {
      ans++;
      (white < black) ? S[i] = '#' : S[i - 1] = '.';
    }
    i++;
  }
  cout << ans << endl;
}
