#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int index = S.find('#'), index2 = S.find_last_of('.');
  int ans = 0, ans2 = 0;
  if (index == string::npos) {
    cout << 0 << endl;
    return 0;
  }
  for (int i = index; i < S.size(); i++) {
    if (S[i] == '.')
      ans++;
    else if (i <= index2)
      ans2++;
  }
  if (ans < ans2)
    cout << ans << endl;
  else
    cout << ans2 << endl;
}
