#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const long long INF = 1e18;
signed main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  long long n;
  string s;
  cin >> n >> s;
  long long ans = n;
  bool f = false;
  for (long long i = 0; i < n; i++) {
    if (f) {
      if (s[i] == '#') ans--;
    } else {
      if (s[i] == '#') f = true;
      ans--;
    }
  }
  long long ans2 = n;
  f = false;
  for (long long i = n - 1; i >= 0; i--) {
    if (f) {
      if (s[i] == '.')
        ans2--;
      else {
        if (s[i] == '.') f = true;
        ans2--;
      }
    }
  }
  cout << min(ans, ans2) << endl;
}
