#include <bits/stdc++.h>
using namespace std;
const int MAX = 510000;
const int MOD = 1000000007;
long long int fac[MAX], finv[MAX], inv[MAX];
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
void COMinit() {
  fac[0] = fac[1] = 1;
  finv[0] = finv[1] = 1;
  inv[1] = 1;
  for (long long int i = 2; i < MAX; i++) {
    fac[i] = fac[i - 1] * i % MOD;
    inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
    finv[i] = finv[i - 1] * inv[i] % MOD;
  }
}
long long int Len(long long int n) {
  long long int s = 0;
  while (n != 0) s++, n /= 10;
  return s;
}
long long int Sint(long long int n) {
  long long int m = 0, s = 0, a = n;
  while (a != 0) s++, a /= 10;
  for (long long int i = s - 1; i >= 0; i--)
    m += n / ((long long int)pow(10, i)) -
         (n / ((long long int)pow(10, i + 1))) * 10;
  return m;
}
long long int Svec(vector<long long int> v) {
  long long int n = 0;
  for (long long int i = 0; i < v.size(); i++) n += v[i];
  return n;
}
long long int GCD(long long int a, long long int b) {
  return b ? GCD(b, a % b) : a;
}
long long int LCM(long long int a, long long int b) {
  return a / GCD(a, b) * b;
}
long long int Factorial(long long int n) {
  long long int m = 1;
  while (n >= 1) m *= n, n--;
  return m;
}
vector<pair<char, long long int>> runlength(
    string s, vector<pair<char, long long int>> p) {
  long long int x = 1;
  if (s.size() == 1) {
    p.push_back(pair<char, long long int>(s[0], 1));
    return p;
  }
  for (long long int i = 0; i < s.size() - 1; i++) {
    if (s[i] == s[i + 1]) {
      x++;
      if (i == s.size() - 2) {
        p.push_back(pair<char, long long int>(s[i], x));
      }
    } else {
      p.push_back(pair<char, long long int>(s[i], x));
      x = 1;
      if (i == s.size() - 2) {
        p.push_back(pair<char, long long int>(s[s.size() - 1], x));
      }
    }
  }
  return p;
}
long long int COM(long long int n, long long int k) {
  if (n < k) return 0;
  if (n < 0 || k < 0) return 0;
  return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
const int MAX_N = 100010;
vector<bool> sieve_of_eratosthenes() {
  vector<bool> isPrime(MAX_N + 1, true);
  for (int i = 2; i <= MAX_N; i++) {
    if (isPrime[i]) {
      for (int j = 2 * i; j <= MAX_N; j += i) {
        isPrime[j] = false;
      }
    }
  }
  return isPrime;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int n, ans = MOD;
  long long int cnt1 = 0, cnt2 = 0;
  string s;
  cin >> n >> s;
  cnt1 = count(s.cbegin(), s.cend(), '.');
  chmin(ans, cnt1 + cnt2);
  for (long long int i = 0; i < (n); i++) {
    if (s[i] == '.') {
      ans -= 2;
    } else {
      ans += 2;
    }
  }
  cout << ans << endl;
}
