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