#include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9 + 7;
const long long LINF = 1e18;
using namespace std;
int main(int argc, char const* argv[]) {
  int n;
  string s;
  cin >> n >> s;
  vector<string> t(5);
  if (n == 1) {
    cout << 0 << endl;
    return 0;
  }
  t[0].push_back('#');
  for (int i = 0; i < (n); ++i) {
    t[1].push_back('.');
  }
  for (int i = 0; i < (n); ++i) {
    t[2].push_back('#');
  }
  int cnt1 = 0;
  int cnt2 = 0;
  for (int i = 0; i < n; ++i) {
    if (s[i] == '#') {
      cnt2 = i;
      break;
    }
  }
  for (int i = n - 1; i >= 0; --i) {
    if (s[i] == '#')
      cnt1++;
    else {
      break;
    }
  }
  for (int i = 0; i < (n - cnt1); ++i) {
    t[3].push_back('.');
  }
  for (int i = 0; i < (cnt1); ++i) t[3].push_back('#');
  for (int i = 0; i < (cnt2); ++i) t[4].push_back('.');
  for (int i = 0; i < (n - cnt2); ++i) t[4].push_back('#');
  long long ans = LINF;
  for (int i = 0; i < (5); ++i) {
    long long tmp = 0;
    for (int j = 0; j < (n); ++j) {
      if (s[j] != t[i][j]) {
        tmp++;
      }
    }
    ans = min(ans, tmp);
  }
  cout << ans << endl;
  return 0;
}
