N = int(input())
S = list(input())
count = 0
list_count =[]
for i in range(N+1):
    count = 0
    for j,s in enumerate(S):
        if(( i > j ) and (s != ".")):
            count+=1
        elif((i <= j) and (s != "#")):
            count+=1
        else:
            pass
    list_count.append(count)
print(min(list_count))