import scala.io.Source.stdin
import scala.util.control.Breaks

/**
  * Created by wintermaples on 2017/06/20.
  */
object Main {

  def main(args : Array[String]) : Unit = {
    val b = new Breaks
    var rectangleNum = 0
    var diamondNum = 0

    stdin.getLines().map(_.split(","))
      .map(sarr => (sarr(0).toInt, sarr(1).toInt, sarr(2).toInt ) )
      .foreach( t => {
        val s1 = t._1
        val s2 = t._2
        val diagonal = t._3
        if (s1*s1 + s2*s2 == diagonal*diagonal)
          rectangleNum += 1
        else if (s1 == s2)
          diamondNum += 1
    })

    println(rectangleNum)
    println(diamondNum)
  }

}