#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<ll, ll>;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll n;
  cin >> n;
  string s;
  cin >> s;
  vll res(2, 0);
  ll flg = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') flg = 1;
    if (flg && s[i] == '.') res[0]++;
  }
  flg = 0;
  for (int i = 0; i < n; i++) {
    if (s[n - 1 - i] == '.') flg = 1;
    if (flg && s[i] == '#') res[1]++;
  }
  sort(res.begin(), res.end());
  ;
  cout << res[0] << endl;
  return 0;
}
