#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  string s;
  cin >> n >> s;
  int ans = 0;
  for (int i = 0; i < n - 1; i++) {
    if (s[i] == '#' && s[i + 1] == '.') {
      int black, white;
      black = 0, white = 0;
      for (int j = 0; i - j >= 0; j++) {
        if (s[i - j] == '#')
          black++;
        else
          break;
      }
      for (int j = 0; i + 1 + j < n; j++) {
        if (s[i + 1 + j] == '.')
          white++;
        else
          break;
      }
      ans += min(black, white);
      i += white;
    }
  }
  cout << ans << '\n';
}
