#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int INF = 100100100;
int gcd(int a, int b) {
  int c;
  if (a < b) {
    a += b;
    b = a - b;
    a -= b;
  }
  while (b != 0) {
    c = a % b;
    a = b;
    b = c;
  }
  return a;
}
int lcm(int m, int n) {
  if ((0 == m) || (0 == n)) return 0;
  return ((m / gcd(m, n)) * n);
}
bool isOK(int index, int key, vector<int> a) {
  if (a[index] >= key)
    return true;
  else
    return false;
}
int meguru_binary_search(int key, vector<int> A) {
  int ng = -1;
  int ok = (int)A.size();
  while (abs(ok - ng) > 1) {
    int mid = (ok + ng) / 2;
    if (isOK(mid, key, A))
      ok = mid;
    else
      ng = mid;
  }
  return ok;
}
int main(void) {
  int n;
  cin >> n;
  string s;
  cin >> s;
  vector<int> sb(n), sw(n);
  if (s[0] == '.') {
    sb[0] = 0;
    sw[0] = 1;
  } else {
    sb[0] = 1;
    sw[0] = 0;
  }
  for (int i = (1); i < (n); i++) {
    if (s[i] == '.') {
      sb[i] = sb[i - 1];
      sw[i] = sw[i - 1] + 1;
    } else {
      sb[i] = sb[i - 1] + 1;
      sw[i] = sw[i - 1];
    }
  }
  int ans = 2000000;
  for (int i = 0; i < n; i++) ans = min(ans, sb[i] + sw[n - 1] - sw[i]);
  cout << ans << endl;
}
