#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  char s[300005];
  scanf("%s", s);
  int flag = 0;
  int j, k;
  if (n == 1) {
    cout << 0;
    return 0;
  }
  for (int i = 0; i < n; i++) {
    if (flag == 0 && s[i] == '#') {
      j = i;
      flag = 1;
      break;
    }
  }
  if (flag == 0) {
    cout << 0;
    return 0;
  }
  int count = 0, count1 = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') count++;
  }
  for (int i = j; i < n; i++) {
    if (s[i] == '.') count1++;
  }
  cout << min(count, count1);
  return 0;
}
