#include <bits/stdc++.h>
using ll = long long;
using namespace std;
const int INF = 1e9;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int w = 0, b = 0, ans = INF;
  for (int i = 0; i < N; ++i)
    if (S[i] == '.') w++;
  for (int i = 0; i < N; ++i) {
    if (S[i] == '#')
      b++;
    else
      w--;
    ans = min(ans, b + w);
  }
  cout << ans << endl;
  return 0;
}
