#include <bits/stdc++.h>
const int INF32 = 2147483647;
const long long INF64 = 9223372036854775807;
using namespace std;
template <class T>
inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  string s;
  cin >> N >> s;
  vector<int> w(N), b(N);
  if (s[0] == '.') {
    w[0] = 1;
  } else {
    b[0] = 1;
  }
  for (int i = 1; i < N; i++) {
    if (s[i] == '.') {
      w[i] += w[i - 1] + 1;
      b[i] = b[i - 1];
    } else {
      w[i] = w[i - 1];
      b[i] = b[i - 1] + 1;
    }
  }
  int ans = INF32;
  for (int i = 0; i < N - 1; i++) {
    int towhite = b[i];
    int toblack = w[N - 1] - w[i];
    int sum = towhite + toblack;
    chmin(ans, sum);
  }
  cout << ans << endl;
  return 0;
}
