#include <bits/stdc++.h>
using namespace std;
template <class T>
T ceil(T a, T b) {
  return (a + b - 1) / b;
}
template <class T>
T round(T a, T b) {
  return (a + b / 2) / b;
}
template <class T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
template <class T>
T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
template <class T>
bool amax(T& a, const T& b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
bool amin(T& a, const T& b) {
  if (b < a) {
    a = b;
    return true;
  }
  return false;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  string S;
  cin >> N >> S;
  vector<int> w(N + 1, 0), b(N + 1, 0);
  for (int i = (int)(0); i < (int)(N); i += (int)(1)) {
    if (i > 0) {
      w[i] = w[i - 1];
      b[i] = b[i - 1];
    }
    if (S[i] == '.') {
      w[i]++;
    } else {
      b[i]++;
    }
  }
  w[N] = w[N - 1];
  b[N] = b[N - 1];
  int res = 200000;
  for (int i = (int)(0); i < (int)(N); i += (int)(1)) {
    amin(res, b[i] + w[N] - w[i]);
  }
  cout << res << endl;
  return 0;
}
