N = int(input())
S = input()

if '.' not in S or '#' not in S:
    print(0)
    exit()

index = 0
for i in range(0,N):
    if S[i] == '#':
        index = i
        break

index2 = 0
for i in range(0,N):
    if S[i] == ".":
        index2 = i

print(min(S[index:].count("."),S[:index2].count("#")))