#include <bits/stdc++.h>
using namespace std;
int main() {
  long N;
  string str;
  cin >> N >> str;
  long count_black = 0;
  long count_1st = 0;
  long count_last = 0;
  bool flag = true;
  reverse(str.begin(), str.end());
  for (long i = 0; i < N; i++) {
    if (str.substr(i, 1) != "#") flag = false;
    if (flag == true) {
      if (str.substr(i, 1) == "#") count_last = i;
    } else
      flag = false;
    if (str.substr(i, 1) == "#") {
      count_black++;
      count_1st = i;
    }
  }
  if (count_black > 0) count_last++;
  long count_min = min(N - count_last, count_black - count_last);
  cout << count_min << endl;
}
