#include <bits/stdc++.h>
using namespace std;
int n, ans;
string s;
int main() {
  int i, x, y;
  cin >> n >> s;
  for (i = 0; i < n;) {
    for (x = 0; i < n && s[i] == '#'; i++, x++)
      ;
    for (y = 0; i < n && s[i] == '.'; i++, y++)
      ;
    ans += min(x, y);
  }
  cout << ans;
  return 0;
}
