#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int count1 = 0, count2 = 0;
  string now, next;
  now = s.substr(0, 1);
  for (int i = 0; i < n - 1; i++) {
    next = s.substr(i + 1, 1);
    if (now == "#" && next == ".") {
      count1++;
      now = "#";
    } else {
      now = next;
    }
  }
  now = s.substr(n - 1, 1);
  for (int i = n - 1; i > 0; i--) {
    next = s.substr(i - 1, 1);
    if (now == "." && next == "#") {
      count2++;
      now = ".";
    } else {
      now = next;
    }
  }
  if (count1 <= count2)
    cout << count1 << endl;
  else
    cout << count2 << endl;
}
