#include <bits/stdc++.h>
using namespace std;
constexpr int inf = 1001001001;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  string s;
  cin >> n >> s;
  int left = 0, right = n;
  for (int i = 0; i < n; ++i) {
    if (s[i] == '#') break;
    ++left;
  }
  for (int i = n - 1; i >= 0; --i) {
    if (s[i] == '.') break;
    --right;
  }
  int ans = inf;
  int cnt1 = 0, cnt2 = 0;
  for (int i = left; i < right; ++i) {
    if (s[i] == '.')
      ++cnt1;
    else
      ++cnt2;
  }
  ans = min(ans, min(cnt1, cnt2));
  cout << ans << endl;
}
