#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
struct __INIT {
  __INIT() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
  }
} __init;
int main(void) {
  int N;
  string S1;
  cin >> N >> S1;
  string S2 = S1;
  int ans1 = 0, ans2 = 0;
  for (int i = 1; i < N; i++)
    if (S1[i - 1] == '#' && S1[i] == '.') ans1++, S1[i] = '#';
  for (int(i) = 0; (i) < (N - 1); (i)++)
    if (S2[i] == '#' && S2[i + 1] == '.') ans2++, S2[i] = '.';
  cout << min(ans1, ans2) << "\n";
}
