#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  vector<int> u, v;
  int m = 0, cnt;
  while (m < n) {
    cnt = 0;
    while (s[m] == '#') {
      cnt++;
      m++;
    }
    u.push_back(cnt);
    cnt = 0;
    while (s[m] == '.') {
      cnt++;
      m++;
    }
    v.push_back(cnt);
  }
  int l = u.size();
  for (int i = 1; i < l; i++) u[i] += u[i - 1];
  for (int i = 1; i < l; i++) v[i] += v[i - 1];
  int ans = n;
  for (int i = 0; i < l; i++) ans = min(ans, u[i] + v[l - 1] - v[i]);
  cout << ans << endl;
  return 0;
}
