#include <bits/stdc++.h>
using namespace std;
int n, a[100005];
int f[100005][3];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    char x;
    cin >> x;
    if (x == '#')
      a[i] = 1;
    else
      a[i] = 0;
  }
  for (int i = 1; i <= n; i++) {
    if (a[i] == 1) {
      f[i][1] = min(f[i - 1][0], f[i - 1][1]);
      f[i][0] = f[i - 1][0] + 1;
    }
    if (a[i] == 0) {
      f[i][0] = f[i - 1][0];
      f[i][1] = min(f[i - 1][0], f[i - 1][1]) + 1;
    }
  }
  cout << min(f[n][0], f[n][1]) << endl;
}
