

n = int(input())
s = list(input())
a = list(map(lambda x:x, s))
def stones(s):
    k = 0
    for i in range(len(s)-1):
        if s[i]=='#' and s[i+1]=='.':
            s[i+1] = '#'
            k = k+1
    return k

def stone(a):
    k = 0
    c = list(reversed(a))
    for w in range(len(c)-1):
        if c[w]=='.' and c[w+1]=='#':
            c[w+1] = '.'
            k = k+1
    return k
print(min(stones(s),stone(a)))