#include <bits/stdc++.h>
#pragma target("avx")
using ll = int_fast64_t;
using P = std::pair<ll, ll>;
using V = std::vector<ll>;
template <typename T>
using pq = std::priority_queue<T>;
template <typename T>
using rpq = std::priority_queue<T, std::vector<T>, std::greater<T>>;
const int MOD = 1e9 + 7;
const ll INF = 1e18;
int dx[] = {0, 1, 0, -1, 1, 1, -1, -1}, dy[] = {1, 0, -1, 0, 1, -1, -1, 1};
int main() {
  int n;
  scanf("%d", &n);
  int b[2 + n], w[2 + n];
  b[0] = w[0] = b[n + 1] = w[n + 1] = 0;
  for (ll i = 1; i < n + 1; i++) {
    if (getchar() == '#')
      b[i] = 1, w[i] = 0;
    else
      b[i] = 0, w[i] = 1;
  }
  for (ll i = 0; i < n + 1; i++) b[i + 1] += b[i];
  for (ll i = 0; i < n + 1; i++) w[n - i] += w[n + 1 - i];
  int ans = 2e9;
  for (ll i = 0; i < n + 2; i++) {
    ans = std::min(ans, b[i] + w[i]);
  }
  printf("%d\n", ans);
  return 0;
}
