#include <bits/stdc++.h>
using namespace std;
int nx[] = {0, 1, 0, -1};
int ny[] = {0, 1, 0, -1};
int N;
int i, f_black, count_b = 0, count_w = 0, ans;
int main(void) {
  cin >> N;
  char S[N];
  scanf("%s", S);
  for (i = 0; i < N; i++) {
    if (S[i] == '#') count_b++;
  }
  for (i = 0; i < N; i++) {
    if (S[i] == '#') f_black = i;
    break;
  }
  for (i = f_black; i < N; i++) {
    if (S[i] == '.') count_w++;
  }
  ans = min(count_w, count_b);
  cout << ans;
  return 0;
}
