#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll M = 1e9 + 7;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int r = 0;
  int l = 0;
  bool flag = true;
  for (int i = 0; i < (int)(n - 1); i++)
    if (s[i] != s[i + 1]) flag = false;
  if (flag) {
    cout << 0 << endl;
    return 0;
  }
  for (int i = 0; i < (int)(n); i++)
    if (s[i] == '.') r++;
  int ans = r;
  for (int i = 0; i < (int)(n); i++) {
    if (s[i] == '#') {
      l++;
      r--;
    }
    ans = min(ans, l + r);
  }
  cout << ans << endl;
  return 0;
}
