gets;p$<.read.split.map{|s|($*[s.hex]^=0)?1:3}.sum/4