#include <bits/stdc++.h>
using namespace std;
int n;
string s, s2;
int solve1(int x, int sum) {
  if (x == n) {
    return sum;
  }
  if (s[x] == '#') {
    if (s[x + 1] == '.') {
      s[x + 1] = '#';
      return solve1(x, sum + 1);
    }
  }
  return solve1(x + 1, sum);
}
int solve2(int x, int sum) {
  if (x > 0 && x == n) {
    return sum;
  }
  if (s2[x] == '#') {
    if (s2[x + 1] == '.') {
      s2[x] = '.';
      return solve2(x - 1, sum + 1);
    }
  }
  return solve2(x + 1, sum);
}
int main(void) {
  cin >> n >> s;
  s2 = s;
  int ans = min(solve1(0, 0), solve2(0, 0));
  cout << ans << endl;
}
