#include <bits/stdc++.h>
using namespace std;
const long long INF = (long long)1e9;
const long long MOD = (long long)1e9 + 7;
const long long MAX = 510000;
vector<int> dx = {1, 0, -1, 0}, dy = {0, 1, 0, -1};
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
int main() {
  long long N, a = 0, b = 0;
  string S, T;
  cin >> N >> S;
  T = S;
  reverse(T.begin(), T.end());
  for (long long i = 0; i < N; i++) {
    if (S[i] == '#' && S[i + 1] == '.') {
      a++;
      S[i + 1] = '#';
    }
  }
  for (long long i = 0; i < N; i++) {
    if (T[i] == '.' && T[i + 1] == '#') {
      b++;
      T[i + 1] = '.';
    }
  }
  cout << min(a, b) << endl;
}
