#include <bits/stdc++.h>
using namespace std;
int min(int a, int b) {
  if (a > b)
    return b;
  else
    return a;
}
int main() {
  int a;
  while (scanf("%d", &a) != EOF) {
    string temp;
    cin >> temp;
    int start = 0;
    int counta = 0, countb = 0;
    for (; a > 0; a--) {
      if (temp[a - 1] != '#') break;
    }
    for (int i = 0; i < a; i++) {
      if (temp[i] == '#') start = 1;
      if (start) {
        if (temp[i] == '#')
          counta++;
        else
          countb++;
      }
    }
    printf("%d\n", min(counta, countb));
  }
  return 0;
}
