from heapq import *
def main():
    N=int(input())
    line = list(input())
    ans=[]

    for i in range(N+1):
        a=line[:i].count("#")
        b=line[i:].count(".")
        heappush(ans,a+b)
    
    return peappop(ans)

print(main())