#include <bits/stdc++.h>
using namespace std;
using pll = pair<long long, long long>;
const long long INF = 1LL << 60;
const long long MM = 1000000000;
const long long MOD = MM + 7;
const long long MMM = 9223372036854775807;
long long GCD(long long x, long long y) {
  if (y == 0)
    return x;
  else
    return GCD(y, x % y);
}
long long LCM(long long x, long long y) { return x / GCD(x, y) * y; }
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;
}
template <typename A, size_t N, typename T>
void FILL(A (&array)[N], const T& val) {
  fill((T*)array, (T*)(array + N), val);
}
long long dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
long long ddx[8] = {1, 1, 0, -1, -1, -1, 0, 1},
          ddy[8] = {0, 1, 1, 1, 0, -1, -1, -1};
int main() {
  long long n, allw = 0, allb = 0;
  cin >> n;
  string s;
  cin >> s;
  bool found = false;
  for (long long i = 0; i < s.size(); i++) {
    if (s[i] == '#') {
      if (!found) found = true;
      allw++;
    }
    if (found && s[i] == '.') allb++;
  }
  cout << min(allw, allb) << endl;
}
