#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 1000000;
const int64_t MAX_N_Int = 1000000000000;
template <typename T>
void printV(const std::vector<T>& v, const char* const separator = " ") {
  if (!v.empty()) {
    std::copy(v.begin(), --v.end(),
              std::ostream_iterator<T>(std::cout, separator));
    std::cout << v.back() << "\n";
  }
}
bool isPrime(int num) {
  if (num < 2)
    return false;
  else if (num == 2)
    return true;
  else if (num % 2 == 0)
    return false;
  double sqrtNum = sqrt(num);
  for (int i = 3; i <= sqrtNum; i += 2) {
    if (num % i == 0) {
      return false;
    }
  }
  return true;
}
int64_t gcd(int64_t a, int64_t b) { return b != 0 ? gcd(b, a % b) : a; }
int64_t lcm(int64_t a, int64_t b) { return a / gcd(a, b) * b; }
int Max(int a, int b, int c) {
  int temp = max(a, b);
  return max(temp, c);
}
int Min(int a, int b, int c) {
  int temp = min(a, b);
  return min(temp, c);
}
bool integer(double num) { return floor(num) == num; }
int64_t fact(int num) {
  if (num == 0)
    return 1;
  else
    return num * fact(num - 1);
}
int64_t yakusu(int n) {
  int cnt = 0;
  for (int i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      cnt++;
      if (i * i != n) cnt++;
    }
  }
  return cnt;
}
int64_t fact_mod(int64_t n, int64_t mod) {
  int64_t f = 1;
  for (int64_t(i) = (2); (i) <= (n); (i)++)
    f = f * (i % 1000000007) % 1000000007;
  return f;
}
int64_t mod_pow(int64_t x, int64_t n, int64_t mod) {
  int64_t res = 1;
  while (n > 0) {
    if (n & 1) res = (res * x) % mod;
    x = (x * x) % mod;
    n >>= 1;
  }
  return res;
}
int64_t combination_mod(int64_t n, int64_t r, int64_t mod) {
  if (r > n - r) r = n - r;
  if (r == 0) return 1;
  int64_t a = 1;
  for (int64_t(i) = (0); (i) < (r); (i)++) a = a * ((n - i) % mod) % mod;
  int64_t b = mod_pow(fact_mod(r, mod), mod - 2, mod);
  return (a % mod) * (b % mod) % mod;
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  ;
  std::cout << std::fixed << std::setprecision(15);
  ;
  int64_t a, b, c, d, n, m, k, x, y = 0, ans = 0, ans1 = 0;
  string str, s = "", t, u;
  cin >> n >> s;
  t = s;
  for (int i = 0; i < n - 1; ++i) {
    if (s[i] == '#' and s[i + 1] == '.') {
      ans++;
      s[i + 1] = '#';
    }
  }
  reverse(t.begin(), t.end());
  for (int i = 0; i < n - 1; ++i) {
    if (t[i] == '.' and t[i + 1] == '#') {
      ans1++;
      t[i + 1] = '.';
    }
  }
  cout << min({ans, ans1});
  cout << "\n";
  return 0;
}
