#include <bits/stdc++.h>
using namespace std;
int white[100005], black[100005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  string s;
  cin >> n >> s;
  white[n - 1] = (int)(s[n - 1] == '.');
  black[0] = (int)(s[0] == '#');
  for (int i = n - 2; i >= 0; i--)
    white[i] += white[i + 1] + (int)(s[i] == '.');
  for (int i = 1; i < n; i++) black[i] += black[i - 1] + (int)(s[i] == '#');
  int result = white[0];
  for (int i = 0; i < n; i++) result = min(result, black[i] + white[i + 1]);
  cout << result << endl;
  return 0;
}
