#include <bits/stdc++.h>
using namespace std;
void b() {
  int a, k;
  string s;
  cin >> a >> s >> k;
  k = k - 1;
  string ans = "";
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == s[k]) {
      ans += s[k];
    } else
      ans += "*";
  }
  cout << ans;
}
void a() {
  int a, b, c;
  cin >> a >> b >> c;
  if ((a > c && c > b) || (a < c && c < b)) {
    cout << "Yes";
  } else
    cout << "No";
}
void c() {
  int n;
  string s;
  cin >> n >> s;
  int count = 0;
  int i = 0;
  while (s[i] != '#') i++;
  while (i != s.length()) {
    int count_a = 0;
    while (i != s.length() && (s[i] == '#')) {
      i++;
      count_a++;
    }
    int count_b = 0;
    while (i != s.length() && (s[i] == '.')) {
      i++;
      count_b++;
    }
    if (count_a < count_b)
      count += count_a;
    else
      count += count_b;
  }
  cout << count;
}
int main(void) { c(); }
