#include <bits/stdc++.h>
void Init() {
  std::cin.tie(0);
  std::ios::sync_with_stdio(false);
  struct Init_caller {
    Init_caller() { Init(); }
  } caller;
}
using namespace std;
using LL = long long;
using st = string;
using vi = vector<LL>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vd = vector<double>;
using vvd = vector<vd>;
using vvvd = vector<vvd>;
using vc = vector<char>;
using vvc = vector<vc>;
using vs = vector<st>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvvb = vector<vvb>;
using qi = queue<LL>;
using qc = queue<char>;
using qs = queue<st>;
using si = stack<LL>;
using sc = stack<char>;
using ss = stack<st>;
using pi = pair<LL, LL>;
using ppi = pair<pi, LL>;
using mll = map<LL, LL>;
using mcl = map<char, LL>;
using vpi = vector<pi>;
using vppi = vector<ppi>;
struct edge {
  LL from, to, cost;
};
void y_n(bool p) {
  p ? cout << "Yes"
           << "\n"
    : cout << "No"
           << "\n";
}
void Y_N(bool p) {
  p ? cout << "YES"
           << "\n"
    : cout << "NO"
           << "\n";
}
LL vmax(vi v, LL n) {
  LL MAX = 0;
  for (LL i = 0; i < n; i++) {
    MAX = max(MAX, v[i]);
  }
  return MAX;
}
LL vmin(vi v, LL n) {
  LL MIN = 1LL << 60;
  for (LL i = 0; i < n; i++) {
    MIN = min(MIN, v[i]);
  }
  return MIN;
}
LL gcd(LL a, LL b) {
  LL r;
  while ((r = a % b) != 0) {
    a = b;
    b = r;
  }
  return b;
}
LL lcm(LL a, LL b) { return (a / gcd(a, b) * b); }
bool is_prime(LL n) {
  for (LL i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      return false;
    }
  }
  return true;
}
void sieve(LL n) {
  vb s(n + 1, true);
  for (LL i = 2; i < n + 1; i++) {
    for (LL j = 2; i * j <= n; j++) {
      s[i * j] = false;
    }
  }
  cout << "2から" << n << "までの素数"
       << "\n";
  for (LL i = 2; i < n + 1; i++) {
    if (s[i]) {
      cout << i << " ";
    }
  }
}
LL factorial(LL n) {
  LL a = 1, ret = 1;
  while (a < n) {
    a++;
    ret *= a;
    ret %= 1000000007;
  }
  return ret;
}
signed main(void) {
  LL n;
  st s;
  cin >> n >> s;
  st t = s;
  LL ans1 = 0, ans2 = 0;
  for (LL i = 1; i < n; i++) {
    if (s[i - 1] == '#' && s[i] == '.') {
      ans1++;
      s[i] = '#';
      for (LL j = 1; i - j > 0 && i + j < n; j++) {
        if (s[i - 1 - j] == '#' && s[i + j] == '.') {
          s[i + j] = '#';
          ans1++;
        }
      }
    }
    if (t[i - 1] == '#' && t[i] == '.') {
      ans2++;
      t[i - 1] = '.';
      for (LL j = 1; i - j > 0 && i + j < n; j++) {
        if (t[i - 1 - j] == '#' && t[i + j] == '.') {
          t[i - 1 - j] = '.';
          ans2++;
        }
      }
    }
  }
  cout << min(ans1, ans2);
  return 0;
}
