n = int(input())
s = input()
s = list(s)

count = 0
white_count = 0
white_count2 = 0

for i in range(n):
    if s[i] == ".":
        white = i
        break

while True:
    try:
        if s[white + count] == ".":
            count += 1
        else:
            break
    except:
        count -= 1
        break

for i in range(n):
    if s[i] == ".":
        white_count += 1

if count > white:
    n = n -white - white_count
    for i in range(n):
        if s[i + white + white_count] == ".":
            white_count2 += 1
    result = white + white_count2
else:
    result = white_count

print(result)
