#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, i = 0, branco = 0, preto = 0;
  char S[200010];
  scanf("%d %s", &N, S);
  while (S[i] != '#') i++;
  while (i < N) {
    if (S[i] == '#')
      preto++;
    else
      branco++;
    i++;
  }
  if (branco < preto and branco != 0)
    cout << branco << endl;
  else
    cout << preto << endl;
  return 0;
}
