#!/usr/bin/env python3
from collections import deque, Counter
from heapq import heappop, heappush
from bisect import bisect_right

def main():
    N = int(input())
    S = input()
    B = S.count('#')
    print(min(B,N-B))

if __name__ == "__main__":
    main()
