import sys
sys.setrecursionlimit(10**9)

def mi(): return map(int,input().split())
def ii(): return int(input())
def isp(): return input().split()
def deb(text): print("-------\n{}\n-------".format(text))

INF=10**20
def main():
    N=ii()
    S=list(input())

    count1 = 0
    for s in S:
        if s == ".":
            count1 += 1
    
    count2 = 0
    for s in S:
        if s == "#":
            count2 += 1
    
    print(min(count1,count2))



if __name__ == "__main__":
    main()