# https://atcoder.jp/contests/sumitrust2019/tasks/sumitb2019_a



Ms = Array.new(2)
Ds = Array.new(2)
2.times do |i|
  Ms[i], Ds[i] = gets.split.map(&:to_i)
end
if Ms[1]==Ms[0]
  puts 0
else 
  puts 1
end
