#include <bits/stdc++.h>
using namespace std;
const int lim = 1000000007;
int main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int a_cnt = 0, b_cnt = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') a_cnt++;
    if (S[i] == '.') b_cnt++;
  }
  int ans = min(a_cnt, b_cnt);
  cout << ans << endl;
  return 0;
}
