#include <bits/stdc++.h>
using namespace std;
using ul = unsigned long;
using ll = long long;
using ld = long double;
using vint = vector<int>;
using vll = vector<ll>;
using pint = pair<int, int>;
using pll = pair<ll, ll>;
using vpint = vector<pint>;
using vpll = vector<pll>;
const int INF = (int)1e9 + 1;
const int MOD = (int)1e9 + 7;
int n;
string s;
int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> n;
  cin >> s;
  int cnt = n;
  for (int i = 0; i < (n); i++)
    if (s[i] == '#') {
      cnt = i;
      break;
    }
  int ans = 0;
  for (int i = (cnt); i < (n); i++) {
    if (s[i] == '.') ans++;
  }
  cout << min(ans, n - cnt - ans) << endl;
  return 0;
}
