#include <bits/stdc++.h>
using namespace std;
int main() {
  long N;
  string str;
  cin >> N;
  cin >> str;
  long long bn = 0, wn = 0;
  long long i = 0;
  while (i < N) {
    if (str[i] == '#') {
      bn++;
      i++;
      break;
    } else {
      i++;
    }
  }
  long long bnc = 0;
  while (i < N) {
    if (str[i] == '#') {
      bn++;
      bnc++;
    } else {
      wn++;
      bnc = 0;
    }
    i++;
  }
  bn -= bnc;
  if (bn < wn) {
    cout << bn << "\n";
  } else {
    cout << wn << "\n";
  }
}
