#include <bits/stdc++.h>
constexpr long long MOD = 1000000007;
int main() {
  int N;
  std::cin >> N;
  std::string s;
  std::cin >> s;
  int ans = INT_MAX;
  int i = s.size() - 1;
  if (s.back() == '.') {
    ans = std::count(s.begin(), s.end(), '#');
    int j = N - 1;
    while (0 <= j && s[j] == '.') --j;
    int w = N - 1 - j;
    while (0 <= j && s[j] == '#') --j;
    i = j;
    if (i < 0) {
      std::cout << ans << std::endl;
      return 0;
    }
    ans = std::min(ans, (int)std::count(s.begin(), s.begin() + i + 1, '#') + w);
    ans = std::min(ans, (int)std::count(s.begin(), s.begin() + i + 1, '.') + w);
    std::cout << ans << std::endl;
    return 0;
  }
  int j = N - 1;
  while (0 <= j && s[j] == '#') --j;
  i = j;
  if (i < 0) {
    std::cout << 0 << std::endl;
    return 0;
  }
  ans = std::min(ans, (int)std::count(s.begin(), s.begin() + i + 1, '#'));
  ans = std::min(ans, (int)std::count(s.begin(), s.begin() + i + 1, '.'));
  std::cout << ans << std::endl;
  return 0;
}
