#include <bits/stdc++.h>
using namespace std;
int solve() {
  int N;
  string S;
  cin >> N >> S;
  auto w = S.rfind('.'), b = S.find('#');
  if (w == string::npos || b == string::npos) return 0;
  return min(count(S.cbegin(), S.cbegin() + w, '#'),
             count(S.cbegin() + b, S.cend(), '.'));
}
int main() { cout << solve() << endl; }
