#include <bits/stdc++.h>
int main(int argc, const char *argv[]) {
  int N;
  std::string S;
  std::cin >> N >> S;
  int count_all_white = std::count(S.begin(), S.end(), '#');
  int count_all_black = std::count(S.begin(), S.end(), '.');
  int first_white = S.find_first_of('.');
  int second_black = S.find_first_of('#', first_white);
  int count_half_white = std::count(S.begin() + second_black, S.end(), '.');
  count_half_white += std::count(S.begin(), S.begin() + first_white, '#');
  int ans = std::min(count_all_white, count_half_white);
  ans = std::min(ans, count_all_black);
  std::cout << ans << std::endl;
}
