#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
inline void amin(T &x, U y) {
  if (y < x) x = y;
}
template <typename T, typename U>
inline void amax(T &x, U y) {
  if (x < y) x = y;
}
const long long inf = 1LL << 58;
const int iinf = 1 << 30;
int main() {
  long long n;
  string s;
  cin >> n >> s;
  long long tmp = 0, tmp2 = 0, count2 = 0, count3 = 0;
  for (int i = 0; i < int(n); i++) {
    if (s[i] == '.') {
      count2++;
      tmp2 = 0;
    }
    if (s[i] == '#') {
      tmp++;
    }
    if (s[i] == '#' && tmp2 == 0) {
      tmp2 = 1;
      count3 += count2;
      count2 = 0;
    }
  }
  count3 += count2;
  long long count = tmp;
  amin(count, count3);
  cout << (count) << endl;
}
