#include <bits/stdc++.h>
const long long INF = (long long)1e18 + 1;
const long long MOD = 1e9 + 7;
namespace util {
std::vector<std::string> split(std::string s, char delimiter) {
  std::vector<std::string> vs;
  std::string sub;
  for (auto c : s) {
    if (c == delimiter)
      vs.push_back(sub), sub.clear();
    else
      sub += c;
  }
  vs.push_back(sub);
  return vs;
}
}  // namespace util
template <class T>
T minimum(T head, T tail) {
  return std::min(head, tail);
}
template <class H, class... T>
H minimum(H head, T... tail) {
  return std::min(head, minimum(tail...));
}
template <class T>
T maximum(T head, T tail) {
  return std::max(head, tail);
}
template <class H, class... T>
H maximum(H head, T... tail) {
  return std::max(head, maximum(tail...));
}
template <class T>
std::ostream& operator<<(std::ostream& os, std::vector<T> v) {
  for (long long i = 0; i < (long long)v.size(); i++) {
    os << " [" << i << "]" << v[i];
    if (i % 10 == 0) os << std::endl;
  }
  return os;
}
template <class T, class S>
std::ostream& operator<<(std::ostream& os, std::vector<std::pair<T, S> > vp) {
  long long i = 0;
  for (auto p : vp) {
    os << " [" << i++ << "]" << p.first << " " << p.second;
    if (i % 10 == 0) os << std::endl;
  }
  return os;
}
void print() { std::cout << std::endl; }
template <typename H>
void print(H head) {
  std::cout << head << std::endl;
}
template <typename H, typename... T>
void print(H head, T... tail) {
  std::cout << head << " ", print(tail...);
}
int main() {
  std::cin.tie(nullptr);
  std::ios::sync_with_stdio(false);
  long long N;
  std::string S;
  std::cin >> N >> S;
  long long cnt1 = 0LL;
  for (long long i = 0; i < N - 1; i++) {
    cnt1 += S[i] == '#' ? 1 : 0;
  }
  long long cnt2 = 0LL;
  for (long long i = 0; i < N; i++) {
    cnt2 += S[i] == '.' ? 1 : 0;
  }
  long long ans = std::min(cnt1, cnt2);
  print(ans);
  return 0;
}
