#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string s;
  cin >> s;
  int white = 0, black = 0;
  for (int i = 0; i < N; i++) {
    if (s.at(i) == '#')
      black++;
    else
      white++;
  }
  int sa = abs(white - black);
  int localmin = 1000;
  for (int i = 0; i < N; i++) {
    if (s.at(i) == '#')
      sa++;
    else
      sa--;
    sa = abs(white - black);
    localmin = min(white, black);
  }
  cout << localmin << endl;
}
