#include <bits/stdc++.h>
using namespace std;
int in() {
  int x;
  scanf("%d", &x);
  return x;
}
long long lin() {
  long long x;
  scanf("%lld", &x);
  return x;
}
void printfv(vector<int> a) {
  int n = a.size();
  for (int i = 0; i < n; ++i) cout << a[i] << " ";
}
int main(void) {
  long n, white = 0, black = 0;
  string s;
  cin >> n >> s;
  for (char c : s) {
    if (c == '.') {
      white++;
    } else if (c == '#') {
      black++;
    }
  }
  if (white == n || black == n) {
    cout << 0;
  } else {
    cout << min(black, white);
  }
  return 0;
}
