#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
const long long INF = 1000000000000000;
long long ma = 1000000000 + 7;
long long h, w, n, m, k;
string s;
string sp;
char maze[60][60];
int dis[60][60];
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int main() {
  cin >> n >> s;
  int res = 100000;
  vector<int> numa(n);
  vector<int> numb(n);
  if (s[0] == '#') {
    numa[0]++;
  } else {
    numb[0]++;
  }
  for (int i = 1; i < n; i++) {
    if (s[i] == '#') {
      numa[i] += numa[i] + 1;
      numb[i] += numb[i];
    } else {
      numb[i] += numb[i] + 1;
      numa[i] += numa[i];
    }
  }
  for (int i = 0; i < n; i++) {
    chmin(res, numa[i] + numb[n - i - 1]);
  }
  cout << res << endl;
}
