#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n;
  cin >> s;
  int ans = 0;
  int ans_1 = 0;
  int ans_2 = 0;
  for (int i = 0; i < n; ++i) {
    if (s[i] == '#') {
      ++ans_2;
      int j = 0;
      for (j = i + 1; j < n; ++j) {
        if (s[j] == '.') {
          ++ans_1;
        } else {
          break;
        }
      }
      for (int k = i + 1; k < n; ++k) {
        if (s[k] == '#') {
          ++ans_2;
        } else {
          break;
        }
      }
      if (ans_1 < ans_2) {
        ans += ans_1;
      } else {
        ans += ans_2;
      }
      ans_1 = 0;
      ans_2 = 0;
      i = j - 1;
    }
  }
  cout << ans << endl;
  return 0;
}
