#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N;
  cin >> S;
  int prev;
  int current;
  int point;
  for (int i = 0; i < N; i++) {
    if (S[i] == '.') {
      point += 1;
    }
  }
  if (point == 0 || point == N) {
    cout << 0 << endl;
    return 0;
  }
  point = 0;
  bool flag;
  for (int i = 0; i < N; i++) {
    if (S[i] == '.') {
      if (flag) {
        point += 1;
      }
    } else {
      flag = true;
    }
  }
  int ans1 = point;
  point = 0;
  int point2 = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') {
      point2 += 1;
    } else {
      point += point2;
      point2 = 0;
    }
  }
  int ans2 = point;
  if (ans1 < ans2) {
    cout << ans1 << endl;
  } else {
    cout << ans2 << endl;
  }
  return 0;
}
