a = "1000000007" c = a.length #cは数値 b = gets.chomp d = b.length #dも数値 if c < d p d - c elsif c > d p c - d else c == d p c - d end