#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N;
  cin >> S;
  string tmp;
  int ni;
  ni = N - 1;
  tmp = S.substr(ni, 1);
  int length;
  if (tmp == "#") {
    while (tmp == "#") {
      ni = ni - 1;
      if (ni >= 0) {
        tmp = S.substr(ni, 1);
      } else {
        tmp = "#";
      }
    }
  }
  if (ni < 0) {
    cout << 0;
  } else {
    length = ni + 1;
    int count_bk = 0;
    while (ni >= 0) {
      tmp = S.substr(ni, 1);
      if (tmp == "#") {
        count_bk = count_bk + 1;
      }
      ni = ni - 1;
    }
    int min;
    min = length - count_bk;
    if (min > count_bk) min = count_bk;
    cout << min;
  }
}
