#include <bits/stdc++.h>
using namespace std;
long long MOD = 10e9 + 7;
int main() {
  int n;
  string s;
  cin >> n;
  cin >> s;
  int black[n], white[n];
  for (int(i) = 0; (i) < (n); (i)++) {
    if (i == 0)
      black[i] = (s[i] == '#' ? 1 : 0);
    else if (s[i] == '#')
      black[i] = black[i - 1] + 1;
    else
      black[i] = black[i - 1];
  }
  for (int i = n - 1; i >= 0; i--) {
    if (i == n - 1)
      white[i] = (s[i] == '.' ? 1 : 0);
    else if (s[i] == '.')
      white[i] = white[i + 1] + 1;
    else
      white[i] = white[i + 1];
  }
  int min_change = min(n - black[n - 1], black[n - 1]);
  int tmp_b, tmp_w;
  for (int(i) = 0; (i) < (n); (i)++) {
    tmp_b = black[i];
    tmp_w = white[i];
    min_change = min(min_change, tmp_b + tmp_w);
  }
  cout << (min_change) << "\n";
  ;
  return 0;
}
