n=2
string_list=[input() for i in range(n)]
c=0
new=''
a=0
for stone in string_list[1]:
    if stone=='#'and c==0:
        c+=1
        new+='#'
    elif stone=='.' and c==1:
        new+='#'
        a+=1
    elif stone=='#' and c==1:
        new+='#'
    elif stone=='.' and c==0:
        new+='.'
print(a)