#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int nums[210000];
  bool b = true;
  int pos = 0;
  int count = 0;
  for (int i = 0; i < n; i++) {
    if (b) {
      if (s[i] == '.') {
        count++;
      } else {
        nums[pos] = count;
        count = 1;
        b = false;
        pos++;
      }
    } else {
      if (s[i] == '#') {
        count++;
      } else {
        nums[pos] = count;
        count = 1;
        b = true;
        pos++;
      }
    }
  }
  nums[pos] = count;
  int result = 200000;
  for (int i = -1; i <= pos; i = i + 2) {
    int lresult = 0, rresult = 0;
    for (int j = 1; j < i; j += 2) {
      lresult += nums[j];
    }
    for (int j = i + 1; j <= pos; j += 2) {
      rresult += nums[j];
    }
    if (result > lresult + rresult) {
      result = lresult + rresult;
    }
  }
  cout << result << endl;
  return 0;
}
