#include <bits/stdc++.h>
#pragma gcc optimize("Ofast")
using namespace std;
using ll = long long;
using Graph = vector<vector<long long>>;
const long long MOD = 1000000007;
const long long INF = 1061109567;
const double EPS = 1e-10;
const double PI = acos(-1.0);
const long long dx[4] = {1, 0, -1, 0};
const long long dy[4] = {0, 1, 0, -1};
class UnionFind {
 public:
  vector<long long> par;
  vector<long long> siz;
  UnionFind(long long sz_) : par(sz_), siz(sz_, 1LL) {
    for (long long i = 0; i < sz_; ++i) par[i] = i;
  }
  void init(ll sz_) {
    par.resize(sz_);
    siz.assign(sz_, 1LL);
    for (long long i = 0; i < sz_; ++i) par[i] = i;
  }
  long long root(long long x) {
    while (par[x] != x) {
      x = par[x] = par[par[x]];
    }
    return x;
  }
  bool merge(long long x, long long y) {
    x = root(x);
    y = root(y);
    if (x == y) return false;
    if (siz[x] < siz[y]) swap(x, y);
    siz[x] += siz[y];
    par[y] = x;
    return true;
  }
  bool issame(long long x, long long y) { return root(x) == root(y); }
  long long size(long long x) { return siz[root(x)]; }
};
long long gcd(long long a, long long b) { return b != 0 ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) { return a * b / gcd(a, b); }
string toStrUp(string str) {
  char diff = 'A' - 'a';
  for (long long i = 0; i < (str.size()); ++i) str[i] += diff;
  return str;
}
string get1ch(string str, long long key) { return str.substr(key, 1); }
map<long long, long long> prime_factor(long long n) {
  map<long long, long long> ret;
  for (long long i = 2; i * i <= n; i++) {
    while (n % i == 0) {
      ret[i]++;
      n /= i;
    }
  }
  if (n != 1) ret[n] = 1;
  return ret;
}
bool is_prime(long long x) {
  for (long long i = 2; i * i <= x; i++) {
    if (x % i == 0) return false;
  }
  return true;
}
template <typename T>
vector<T> convert_base(T x, T b) {
  vector<T> ret;
  T t = 1, k = abs(b);
  while (x) {
    ret.emplace_back((x * t) % k);
    if (ret.back() < 0) ret.back() += k;
    x -= ret.back() * t;
    x /= k;
    t *= b / k;
  }
  if (ret.empty()) ret.emplace_back(0);
  reverse(begin(ret), end(ret));
  return ret;
}
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;
}
long long modPow(long long a, long long n) {
  if (n == 1) return a % MOD;
  if (n % 2 == 1) return (a * modPow(a, n - 1)) % MOD;
  long long t = modPow(a, n / 2);
  return (t * t) % MOD;
}
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(15);
  long long n = 0, m = 0, a = 0, b = 0, c = 0, d = 0, x = 0, y = 0, z = 0;
  string s = "", t = "";
  cin >> n >> s;
  string s1 = s;
  string s2 = s;
  for (long long i = 0; i < (n - 1); ++i) {
    if (s1[i] == '#' && s1[i + 1] == '.') {
      ++x;
      s1[i + 1] = '#';
    }
  }
  for (long long i = (n - 1 - 1); i >= 0; --i) {
    if (s2[i] == '#' && s2[i + 1] == '.') {
      ++y;
      s2[i] = '.';
    }
  }
  cout << min(x, y) << '\n';
}
