#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  cout << min(count(S.cbegin(), S.cbegin() + S.rfind('.'), '#'),
              count(S.cbegin() + S.find('#'), S.cend(), '.'))
       << endl;
}
