#include <bits/stdc++.h>
using namespace std;
using p = pair<long long, long long>;
long long dx[8] = {0, 1, 0, -1, 1, 1, -1, -1};
long long dy[8] = {1, 0, -1, 0, 1, -1, 1, -1};
int main(void) {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  long long now = 0;
  for (long long i = 0; i < n; i++) {
    now = i;
    if (s[i] == '#') break;
  }
  long long ans = 0;
  for (long long i = now + 1; i < n; i++) {
    if (s[i] == '.') ans++;
  }
  cout << min(n - now - ans, ans) << endl;
  return 0;
}
