#include <bits/stdc++.h>
using namespace std;
const double PI = 3.14159265358979323846;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  string s;
  cin >> N >> s;
  int ans1 = 0;
  int ans2 = 0;
  string t(s);
  for (int i = s.size() - 1; i > 0; --i) {
    if (s[i - 1] == '#' && s[i] == '.') {
      s[i - 1] = '.';
      ++ans1;
    }
  }
  for (int i = 0; i < t.size() - 1; ++i) {
    if (t[i] == '#' && t[i + 1] == '.') {
      t[i + 1] = '#';
      ++ans2;
    }
  }
  cout << ((ans1) > (ans2) ? (ans2) : (ans1)) << "\n";
  return 0;
}
