#include <bits/stdc++.h>
using namespace std;
const int N = (int)2e5 + 7;
const int inf = (int)1e9 + 7;
const int mod = (int)1e9 + 7;
const long long linf = (long long)1e18 + 7;
const int dx[] = {-1, 0, 1, 0, 1, -1, -1, 1};
const int dy[] = {0, 1, 0, -1, 1, -1, 1, -1};
const int kx[] = {-1, 1, 2, 2, 1, -1, -2, -2};
const int ky[] = {2, 2, 1, -1, -2, -2, -1, 1};
string conv(int a) {
  stringstream ss;
  ss << a;
  string str = ss.str();
  return str;
}
string conv(char a) {
  stringstream ss;
  ss << a;
  string str = ss.str();
  return str;
}
int conv(string a) {
  stringstream geek(a);
  int x = 0;
  geek >> x;
  return x;
}
string cad;
char second[5000];
int memoA[N];
int memoB[N];
int B(int i) {
  int &m = memoB[i];
  if (m != -1) return m;
  if (i == 0) return 0;
  if (second[i] == '.') {
    m = B(i - 1);
    return m;
  } else {
    m = B(i - 1) + 1;
    return m;
  }
}
int A(int i) {
  int &m = memoA[i];
  if (m != -1) return m;
  if (i == 0) return inf;
  if (second[i] == '.') {
    m = min(A(i - 1), B(i - 1)) + 1;
    ;
    return m;
  } else {
    m = min(A(i - 1), B(i - 1));
    return m;
  }
}
int main(void) {
  memset(memoA, -1, sizeof(memoA));
  memset(memoB, -1, sizeof(memoB));
  int x;
  cin >> x;
  cin >> cad;
  int n = (int)cad.size();
  for (int i = (0); i <= (n - 1); i++) second[i + 1] = cad[i];
  cout << min(A(n), B(n));
  return 0;
}
