#include <bits/stdc++.h>
using namespace std;
const long double PI = (acos(-1));
const long long MOD = 1000000007;
struct Edge {
  long long to;
  long long cost;
};
using Graph = vector<vector<Edge>>;
using P = pair<long long, long long>;
const long long INF = 1LL << 60;
bool is_prime(long long x) {
  for (long long i = 2; i * i <= x; i++) {
    if (x % i == 0) return false;
  }
  return true;
}
long long modpow(long long a, long long n, long long m) {
  long long ans = 1;
  while (n) {
    if (n & 1) {
      ans = (ans * a) % m;
    }
    a = (a * a) % m;
    n >>= 1;
  }
  return ans;
}
long long combi(long long n, long long a) {
  long long ans = 1, ans1 = 1;
  for (long long i = n - a + 1; i <= n; i++) {
    ans *= i % MOD;
    ans %= MOD;
  }
  for (long long i = 2; i <= a; i++) ans1 = (ans1 * i) % MOD;
  ans1 = modpow(ans1, MOD - 2, MOD);
  return ((ans % MOD) * ans1) % MOD;
}
template <typename T>
bool next_combination(const T first, const T last, int k) {
  const T subset = first + k;
  if (first == last || first == subset || last == subset) {
    return false;
  }
  T src = subset;
  while (first != src) {
    src--;
    if (*src < *(last - 1)) {
      T dest = subset;
      while (*src >= *dest) {
        dest++;
      }
      iter_swap(src, dest);
      rotate(src + 1, dest + 1, last);
      rotate(subset, subset + (last - dest) - 1, last);
      return true;
    }
  }
  rotate(first, subset, last);
  return false;
}
void dfs(vector<long long> s, long long mi, long long mx, long long N,
         vector<vector<long long>> &arr) {
  if (s.size() == (size_t)N) {
    arr.push_back(s);
  } else {
    for (long long c = s.size() > 0 ? s[s.size() - 1] : mi; c <= mx; c++) {
      s.push_back(c);
      dfs(s, mi, mx, N, arr);
      s.pop_back();
    }
  }
  return;
}
int bfs(int sx, int sy, int gx, int gy, int h, int w,
        vector<vector<char>> map) {
  queue<pair<int, int>> s;
  vector<vector<long long>> ans;
  for (int i = 0; i < h; i++) {
    vector<long long> aa(w);
    ans.push_back(aa);
  }
  s.push(make_pair(sx, sy));
  while (s.size() > 0) {
    pair<int, int> tmp = s.front();
    s.pop();
    map[tmp.first][tmp.second] = '#';
    for (int i = -1; i <= 1; i++) {
      for (int j = -1; j <= 1; j++) {
        if (tmp.first + i < 0 || tmp.first + i >= h) {
          continue;
        }
        if (tmp.second + j < 0 || tmp.second + j >= w) {
          continue;
        }
        if (i != 0 && j != 0) {
          continue;
        }
        if (i == 0 && j == 0) {
          continue;
        }
        if (map[tmp.first + i][tmp.second + j] == '#') {
          continue;
        }
        map[tmp.first + i][tmp.second + j] = '#';
        if (ans[tmp.first + i][tmp.second + j] == 0) {
          ans[tmp.first + i][tmp.second + j] = ans[tmp.first][tmp.second] + 1;
        } else {
          ans[tmp.first + i][tmp.second + j] =
              min(ans[tmp.first + i][tmp.second + j],
                  ans[tmp.first][tmp.second] + 1);
        }
        s.push(make_pair(tmp.first + i, tmp.second + j));
      }
    }
  }
  return ans[gy][gx];
}
long long modfactorial(long long a) {
  if (a == 1) return 1;
  return (a % MOD) * (modfactorial(a - 1) % MOD);
}
long long gcd(long long a, long long b) {
  if (a % b == 0) {
    return (b);
  } else {
    return (gcd(b, a % b));
  }
}
long long lcm(long long a, long long b) { return (a / gcd(a, b)) * b; }
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;
}
void dijkstra(const Graph &G, int s, vector<long long> &dis,
              vector<long long> &prev) {
  int N = G.size();
  dis.resize(N, INF);
  prev.resize(N, -1);
  priority_queue<P, vector<P>, greater<P>> pq;
  dis[s] = 0;
  pq.emplace(dis[s], s);
  while (!pq.empty()) {
    P p = pq.top();
    pq.pop();
    int v = p.second;
    if (dis[v] < p.first) {
      continue;
    }
    for (auto &e : G[v]) {
      if (dis[e.to] > dis[v] + e.cost) {
        dis[e.to] = dis[v] + e.cost;
        prev[e.to] = v;
        pq.emplace(dis[e.to], e.to);
      }
    }
  }
}
vector<long long> get_path(const vector<long long> &prev, long long t) {
  vector<long long> path;
  for (long long cur = t; cur != -1; cur = prev[cur]) {
    path.push_back(cur);
  }
  reverse(path.begin(), path.end());
  return path;
}
vector<string> split(string &s, char delim) {
  vector<string> elems;
  stringstream ss(s);
  string item;
  while (getline(ss, item, delim)) {
    if (!item.empty()) {
      elems.push_back(item);
    }
  }
  return elems;
}
vector<long long> divisor(long long n) {
  vector<long long> ret;
  for (long long i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      ret.push_back(i);
      if (i * i != n) ret.push_back(n / i);
    }
  }
  sort(begin(ret), end(ret));
  return (ret);
}
int main() {
  long long n;
  string s;
  cin >> n >> s;
  string sorg = s;
  long long cnt = 0;
  for (int i = 0; i < n - 1; i++) {
    if (s[i] == '#' && s[i + 1] == '.') {
      s[i + 1] = '#';
      cnt++;
    }
  }
  s = sorg;
  long long cnt2 = 0;
  for (int i = 0; i < n - 1; i++) {
    if (s[n - 1 - i] == '.' && s[n - 2 - i] == '#') {
      s[n - 2 - i] = '.';
      cnt2++;
    }
  }
  cout << min(cnt, cnt2) << endl;
  return 0;
}
