#include <bits/stdc++.h>
using namespace std;
int N;
string S;
int main() {
  cin >> N >> S;
  int ans = 0, ans2 = 0;
  bool s = false, t = false;
  for (int i = 0; i < N; i++) {
    if (s && S[i] == '.') ans++;
    if (t && S[N - 1 - i] == '#') ans2++;
    if (!s && S[i] == '#') s = true;
    if (!t && S[N - 1 - i] == '.') t = true;
  }
  cout << min(ans, ans2) << endl;
}
