#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long n;
  string s;
  cin >> n >> s;
  long long b[222222], w[222222];
  long long kb = 0, kw = 0;
  b[0] = 0;
  w[0] = 0;
  for (long long i = 1; i <= s.size(); i++) {
    if (s[i] == '#')
      kb++;
    else
      kw++;
    b[i] = kb;
    w[i] = kw;
  }
  long long min = 2147483647;
  for (long long i = 0; i < s.size() + 1; i++) {
    min = std::min(b[i] + w[s.size()] - w[i], min);
  }
  cout << min << endl;
}
