#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  int count = 0;
  int black = 0;
  int white = 0;
  int Ans = 0;
  bool Trans = true;
  cin >> N >> S;
  for (int i = 0; i < N; i++) {
    if (S.at(i) == '.') {
      for (int j = 0; j < count + 1; j++) {
        if (S.at(i - count + j) == '#') {
          black++;
        } else {
          white++;
        }
      }
      if (white <= black && Trans == true) {
        Ans += white;
      } else {
        Ans += black;
        Trans = false;
      }
      count = 0;
      black = 0;
      white = 0;
    } else {
      count++;
    }
  }
  cout << Ans << endl;
}
