#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
using Graph = vector<vector<int>>;
const long long MOD = 1000000007;
const long long INF = 1LL << 60;
const int INT_INF = 1000000000;
int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int N;
  string S;
  cin >> N >> S;
  int ans = 10000000;
  vector<int> black(N), white(N);
  if (S[0] == '#')
    black[0] = 1;
  else
    white[0] = 1;
  for (int i = 1; i < N; i++) {
    black[i] += black[i - 1];
    white[i] += white[i - 1];
    if (S[i] == '#')
      black[i]++;
    else
      white[i]++;
  }
  for (int i = 0; i < N; i++) {
    int tmp = 0;
    if (i == 0) {
      tmp = white[N - 1];
    } else if (i == N - 1) {
      tmp = black[N - 1];
    } else {
      tmp = black[i - 1] + (white[N - 1] - white[i - 1]);
    }
    ans = min(ans, tmp);
  }
  cout << ans << endl;
  return 0;
}
