#include <bits/stdc++.h>
using namespace std;
int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  string s;
  cin >> n;
  cin >> s;
  int count_B = 0, count_W = 0;
  int count = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#' && count == 0)
      count++;
    else if (s[i] == '.' && count != 0)
      count_B++;
    if (s[i] == '#') count_W++;
  }
  cout << min(count_B, count_W) << endl;
  return 0;
}
