#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  string s;
  cin >> n >> s;
  int l = 0;
  int r = n - 1;
  while (s[l] == '.') l++;
  while (s[r] == '#') r--;
  int cnt = 0;
  for (int i = l; i <= r; i++) {
    if (s[i] == '#') cnt++;
  }
  cnt = min(cnt, r - l + 1 - cnt);
  cout << cnt << "\n";
  return 0;
}
