#include <bits/stdc++.h>
using namespace std;
long long n, b = 0, w = 0, cnt = 0;
long long ans[3];
bool bl = false;
string s;
signed main() {
  cin >> n >> s;
  for (long long i = 0; i < n; i++) {
    if (s[i] == '.')
      w++;
    else
      b++;
    if (s[i] == '#') bl = true;
    if (bl == true && s[i] == '.') cnt++;
  }
  ans[0] = w;
  ans[1] = b;
  ans[2] = cnt;
  sort(ans, ans + 3);
  cout << ans[0] << endl;
  return 0;
}
