#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
vector<int> v;
int main() {
  int n;
  string s;
  scanf("%d", &n);
  cin >> s;
  int p = -1;
  for (int i = 0; i < (n); i++) {
    if (s[i] == '#') {
      p = i;
      break;
    }
  }
  if (p < 0)
    printf("0\n");
  else {
    int m = 0, mm = 0;
    for (int i = (p); i <= (n - 1); i++) {
      if (s[i] == '#') {
        if (mm) v.push_back(mm), mm = 0;
        m++;
      } else {
        if (m) v.push_back(m), m = 0;
        mm++;
        if (i == (n - 1)) v.push_back(mm);
      }
    }
  }
  int len = v.size(), ans = 0, sum = 0;
  for (int i = 0; i < len; i += 2) ans += v[i], sum += v[i + 1];
  printf("%d\n", min(ans, sum));
}
