#include <bits/stdc++.h>
using namespace std;
constexpr long long mod = 1000000007;
constexpr long long INF = (1ll << 60);
constexpr double pi = 3.14159265358979323846;
template <typename T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
int main() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  long long ans1 = 0, ans2 = 0;
  string ins = s;
  reverse(ins.begin(), ins.end());
  for (long long i = 0; i < s.size() - 1; ++i) {
    if (s[i] == '#' && s[i + 1] == '.') {
      s[i + 1] = '#';
      ans1++;
    }
  }
  for (long long i = 0; i < ins.size() - 1; ++i) {
    if (ins[i] == '.' && ins[i + 1] == '#') {
      ins[i + 1] = '.';
      ans2++;
    }
  }
  cout << min(ans1, ans2) << "\n";
  return 0;
}
