#include <bits/stdc++.h>
int main() {
  std::cin.tie(nullptr);
  std::ios::sync_with_stdio(false);
  int N;
  std::string S;
  std::cin >> N >> S;
  int min = N;
  for (int i = 0; i <= N; ++i) {
    int change = 0;
    for (int j = 0; j < i; ++j)
      if (S[j] == '#') ++change;
    for (int j = i; j < N; ++j)
      if (S[j] == '.') ++change;
    min = std::min(min, change);
  }
  std::cout << min << std::endl;
}
