program palindrome_philia
    implicit none
    character(100):: s
    integer(4):: i, ans, s_len

    read*, s
    ans = 0
    s_len = len_trim(s)
    
    do i = 1, s_len/2
        if (s(i:i) /= s(s_len-i+1:s_len-i+1)) ans = ans+1
    end do

    print*, ans
end program palindrome_philia