#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string s;
  cin >> N;
  cin >> s;
  int i = 0;
  int count = 0;
  while (i < N) {
    if (s[i] == '.')
      ++i;
    else
      break;
  }
  if (i == N)
    cout << 0 << endl;
  else {
    while (i < N) {
      int black = 0, white = 0;
      while (i < N) {
        if (s[i] == '#') {
          black++;
          ++i;
        } else
          break;
      }
      while (i < N) {
        if (s[i] == '.') {
          white++;
          ++i;
        } else
          break;
      }
      if (black < white)
        count += black;
      else
        count += white;
    }
    cout << count << endl;
  }
  return 0;
}
