#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int a[n];
  int count_b = 0;
  int count_w = 0;
  int flag_b = -1;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      a[i] = i;
      if (flag_b == -1) {
        flag_b = i;
      }
    } else {
      a[i] = -1;
    }
  }
  int num = 0;
  for (int i = n - 1; i > -1; i--) {
    if (s[i] != '#') {
      break;
    } else {
      num = i;
    }
  }
  int flag = 0;
  if (num == 0) {
  } else {
    flag = 1;
  }
  if (flag == 0) {
    for (int i = flag_b; i < n; i++) {
      if (s[i] == '#') {
        count_b++;
      } else {
        count_w++;
      }
    }
    int count = 0;
    if (s[n - 1] == '#') {
      count = 1;
    }
    if (count_b - count <= count_w) {
      cout << count_b - count << endl;
    } else {
      cout << count_w << endl;
    }
  } else {
    for (int i = flag_b; i <= num; i++) {
      if (s[i] == '#') {
        count_b++;
      } else {
        count_w++;
      }
    }
    int count = 0;
    if (s[n - 1] == '#') {
      count = 1;
    }
    if (count_b - count <= count_w) {
      cout << count_b - count << endl;
    } else {
      cout << count_w << endl;
    }
  }
}
