#!/usr/bin/ruby
gets
p gets.split.map{|e|e.to_i%2*2-1}.reduce(:+).abs