def f(n) m = 2 * n ans = 0 xs={} xs[0]=1 m.times do ys = {} xs.keys.each do |x| if ys[x-1] == nil ys[x-1] = xs[x] else ys[x-1] += xs[x] end if ys[x+1] == nil ys[x+1] = xs[x] else ys[x+1] += xs[x] end end ans += ys[n] if ys[n] != nil xs = ys.clone xs[n] = 0 end ans end p f(gets.to_i)