#include <bits/stdc++.h>
using namespace std;
long long INF = 1 << 29;
int main() {
  ios::sync_with_stdio(false);
  int n, black = 0, white = 0;
  string s;
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#')
      black++;
    else
      white++;
  }
  int b = 0, w = 0, ans = INT_MAX;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#')
      b++;
    else
      w++;
    ans = min(ans, b + white - w);
  }
  cout << ans << endl;
  return 0;
}
