fun main(args : Array<String>){

    var array1 = readLine()?.split(" ")?.map(String::toInt)
    var array2 = readLine()?.split(" ")?.map(String::toInt)

    var ret = 0
    if( array1 != null && array2 != null ){
        if( array1[0] != array2[0] ){
            ret = 1
        }
    }

    print(ret)


}