N = gets.to_i
ary = gets.split.map(&:to_i)
# 奇数番をマイナスにするケース
cnt1 = 0
sum = 0
ary.each_with_index do |n, i|
    diff = 0
    sum += n
    if i.odd?
        if sum >= 0
            diff = -sum - 1
        end
    else
        if sum <= 0
            diff = -sum + 1
        end
    end
    cnt1 += diff.abs
    sum += diff
end
# 偶数番をマイナスにするケース
cnt2 = 0
sum = 0
ary.each_with_index do |n, i|
    diff = 0
    sum += n
    if i.even?
        if sum >= 0
            diff = -sum - 1
        end
    else
        if sum <= 0
            diff = -sum + 1
        end
    end
    cnt2 += diff.abs
    sum += diff
end
# プラスとマイナスで操作数の小さいほうを採用
puts [cnt1, cnt2].min


#include <iostream>
#include <string>

using namespace std;

int main() {
    for (int _=0; _<3; _++) {
        string s;
        cin >> s;
        cout << char(s[0] + ('A' - 'a')) ;
    }
    cout << endl;
}


a,b,c=input().split()
print((a[0]+b[0]+c[0]).upper())


#![allow(unused, non_snake_case, dead_code, non_upper_case_globals)]
use std::cmp::*;
use std::collections::*;
use std::mem::*;

fn main() {
    let (r, w, e) = (std::io::stdin(), std::io::stdout(), std::io::stderr());
    let mut io = IO::new(r.lock(), w.lock(), e.lock());
    assert_eq!(!0usize, std::usize::MAX); //🙊
    assert!(0 == 0); //😇
    let s1 = io.chars();
    let s2 = io.chars();
    let s3 = io.chars();

    io.write((s1[0] as u8 - b'a' + b'A') as char);
    io.write((s2[0] as u8 - b'a' + b'A') as char);
    io.write((s3[0] as u8 - b'a' + b'A') as char);
}

static MX: usize = 1010101;
static MOD: i64 = 1000000007;
static INF: i64 = std::i64::MAX >> 1;
// IO
use std::io::*;
struct IO<R: Read, W: Write, E: Write> {
    Read: R,
    Write: BufWriter<W>,
    Error: BufWriter<E>,
}
impl<R: Read, W: Write, E: Write> IO<R, W, E> {
    fn new(r: R, w: W, e: E) -> IO<R, W, E> {
        IO {
            Read: r,
            Write: BufWriter::new(w),
            Error: BufWriter::new(e),
        }
    }
    fn read<T>(&mut self) -> T
    where
        T: std::str::FromStr,
    {
        let next: String = self
            .Read
            .by_ref()
            .bytes()
            .map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect();
        next.parse().ok().unwrap()
    }
    fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
    fn chari(&mut self) -> Vec<i64> {
        self.chars()
            .iter()
            .map(|&c| (c as u8 - b'0') as i64)
            .collect::<Vec<i64>>()
    }
    fn readn<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read::<T>()).collect::<Vec<_>>()
    }
    fn readmat<T: std::str::FromStr>(&mut self, n: usize, m: usize) -> Vec<Vec<T>> {
        (0..n).map(|_| self.readn(m)).collect()
    }
    fn write<S: ToString>(&mut self, val: S) {
        self.Write.write(val.to_string().as_bytes());
    }
    fn writeln<S: ToString>(&mut self, val: S) {
        self.Write.write(val.to_string().as_bytes());
        self.Write.write(b"\n");
    }
    fn debug<S: std::fmt::Debug>(&mut self, val: S) {
        writeln!(self.Error, "(debug) {:?}", &val);
    }
    fn debug2<S: std::fmt::Debug, T: std::fmt::Debug>(&mut self, val1: S, val2: T) {
        writeln!(self.Error, "(debug2) {:?} -> {:?}", val1, val2);
    }
    fn debug3<S: std::fmt::Debug, T: std::fmt::Debug, U: std::fmt::Debug>(
        &mut self,
        val1: S,
        val2: T,
        val3: U,
    ) {
        writeln!(
            self.Error,
            "(debug3) {:?} -> {:?} -> {:?}",
            val1, val2, val3
        );
    }
}


use std::io;

fn main() {
	let mut buf = String::new();
	io::stdin().read_line(&mut buf).expect("");
	let iter = buf.split_whitespace();
	let mut v:Vec<Vec<char>> = Vec::new();
	for i in iter {
		v.push(i.chars().collect::<Vec<char>>());
	}
	let s1 = v[0].clone();
	let s1c = s1[0].to_uppercase().collect::<Vec<char>>();
	let s2 = v[1].clone();
	let s2c = s2[0].to_uppercase().collect::<Vec<char>>();
	let s3 = v[2].clone();
	let s3c = s3[0].to_uppercase().collect::<Vec<char>>();
	let s = format!("{}{}{}", s1c[0], s2c[0], s3c[0]);
	println!("{}", s);
}


#![allow(unused, non_snake_case, dead_code, non_upper_case_globals)]
use std::cmp::*;
use std::collections::*;
use std::mem::*;

fn main() {
    let (r, w, e) = (std::io::stdin(), std::io::stdout(), std::io::stderr());
    let mut io = IO::new(r.lock(), w.lock(), e.lock());
    assert_eq!(!0usize, std::usize::MAX); //🙊
    assert!(0 == 0); //😇
    let s1 = io.chars();
    let s2 = io.chars();
    let s3 = io.chars();
    println!(
        "{}{}{}",
        s1[0].to_string().to_uppercase().to_string(),
        s2[0].to_string().to_uppercase().to_string(),
        s3[0].to_string().to_uppercase().to_string()
    );
}

static MX: usize = 1010101;
static MOD: i64 = 1000000007;
static INF: i64 = std::i64::MAX >> 1;
// IO
use std::io::*;
struct IO<R: Read, W: Write, E: Write> {
    Read: R,
    Write: BufWriter<W>,
    Error: BufWriter<E>,
}
impl<R: Read, W: Write, E: Write> IO<R, W, E> {
    fn new(r: R, w: W, e: E) -> IO<R, W, E> {
        IO {
            Read: r,
            Write: BufWriter::new(w),
            Error: BufWriter::new(e),
        }
    }
    fn read<T>(&mut self) -> T
    where
        T: std::str::FromStr,
    {
        let next: String = self
            .Read
            .by_ref()
            .bytes()
            .map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect();
        next.parse().ok().unwrap()
    }
    fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
    fn chari(&mut self) -> Vec<i64> {
        self.chars()
            .iter()
            .map(|&c| (c as u8 - b'0') as i64)
            .collect::<Vec<i64>>()
    }
    fn readn<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read::<T>()).collect::<Vec<_>>()
    }
    fn readmat<T: std::str::FromStr>(&mut self, n: usize, m: usize) -> Vec<Vec<T>> {
        (0..n).map(|_| self.readn(m)).collect()
    }
    fn write<S: ToString>(&mut self, val: S) {
        self.Write.write(val.to_string().as_bytes());
    }
    fn writeln<S: ToString>(&mut self, val: S) {
        self.Write.write(val.to_string().as_bytes());
        self.Write.write(b"\n");
    }
    fn debug<S: std::fmt::Debug>(&mut self, val: S) {
        writeln!(self.Error, "(debug) {:?}", &val);
    }
    fn debug2<S: std::fmt::Debug, T: std::fmt::Debug>(&mut self, val1: S, val2: T) {
        writeln!(self.Error, "(debug2) {:?} -> {:?}", val1, val2);
    }
    fn debug3<S: std::fmt::Debug, T: std::fmt::Debug, U: std::fmt::Debug>(
        &mut self,
        val1: S,
        val2: T,
        val3: U,
    ) {
        writeln!(
            self.Error,
            "(debug3) {:?} -> {:?} -> {:?}",
            val1, val2, val3
        );
    }
}


#![allow(unused, non_snake_case, dead_code, non_upper_case_globals)]
use std::cmp::*;
use std::collections::*;
use std::mem::*;

fn main() {
    let (r, w, e) = (std::io::stdin(), std::io::stdout(), std::io::stderr());
    let mut io = IO::new(r.lock(), w.lock(), e.lock());
    assert_eq!(!0usize, std::usize::MAX); //🙊
    assert!(0 == 0); //😇
    let s1 = io.chars();
    let s2 = io.chars();
    let s3 = io.chars();
    println!(
        "{}{}{}",
        s1[0].to_uppercase().to_string(),
        s2[0].to_uppercase().to_string(),
        s3[0].to_uppercase().to_string()
    );
}

static MX: usize = 1010101;
static MOD: i64 = 1000000007;
static INF: i64 = std::i64::MAX >> 1;
// IO
use std::io::*;
struct IO<R: Read, W: Write, E: Write> {
    Read: R,
    Write: BufWriter<W>,
    Error: BufWriter<E>,
}
impl<R: Read, W: Write, E: Write> IO<R, W, E> {
    fn new(r: R, w: W, e: E) -> IO<R, W, E> {
        IO {
            Read: r,
            Write: BufWriter::new(w),
            Error: BufWriter::new(e),
        }
    }
    fn read<T>(&mut self) -> T
    where
        T: std::str::FromStr,
    {
        let next: String = self
            .Read
            .by_ref()
            .bytes()
            .map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect();
        next.parse().ok().unwrap()
    }
    fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
    fn chari(&mut self) -> Vec<i64> {
        self.chars()
            .iter()
            .map(|&c| (c as u8 - b'0') as i64)
            .collect::<Vec<i64>>()
    }
    fn readn<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read::<T>()).collect::<Vec<_>>()
    }
    fn readmat<T: std::str::FromStr>(&mut self, n: usize, m: usize) -> Vec<Vec<T>> {
        (0..n).map(|_| self.readn(m)).collect()
    }
    fn write<S: ToString>(&mut self, val: S) {
        self.Write.write(val.to_string().as_bytes());
    }
    fn writeln<S: ToString>(&mut self, val: S) {
        self.Write.write(val.to_string().as_bytes());
        self.Write.write(b"\n");
    }
    fn debug<S: std::fmt::Debug>(&mut self, val: S) {
        writeln!(self.Error, "(debug) {:?}", &val);
    }
    fn debug2<S: std::fmt::Debug, T: std::fmt::Debug>(&mut self, val1: S, val2: T) {
        writeln!(self.Error, "(debug2) {:?} -> {:?}", val1, val2);
    }
    fn debug3<S: std::fmt::Debug, T: std::fmt::Debug, U: std::fmt::Debug>(
        &mut self,
        val1: S,
        val2: T,
        val3: U,
    ) {
        writeln!(
            self.Error,
            "(debug3) {:?} -> {:?} -> {:?}",
            val1, val2, val3
        );
    }
}


#![allow(unused, non_snake_case, dead_code, non_upper_case_globals)]
use std::cmp::*;
use std::collections::*;
use std::mem::*;

fn main() {
    let (r, w, e) = (std::io::stdin(), std::io::stdout(), std::io::stderr());
    let mut io = IO::new(r.lock(), w.lock(), e.lock());
    assert_eq!(!0usize, std::usize::MAX); //🙊
    assert!(0 == 0); //😇
    let s1 = io.chars();
    let s2 = io.chars();
    let s3 = io.chars();
    println!(
        "{}{}{}",
        s1[0].to_uppercase(),
        s2[0].to_uppercase(),
        s3[0].to_uppercase()
    );
}

static MX: usize = 1010101;
static MOD: i64 = 1000000007;
static INF: i64 = std::i64::MAX >> 1;
// IO
use std::io::*;
struct IO<R: Read, W: Write, E: Write> {
    Read: R,
    Write: BufWriter<W>,
    Error: BufWriter<E>,
}
impl<R: Read, W: Write, E: Write> IO<R, W, E> {
    fn new(r: R, w: W, e: E) -> IO<R, W, E> {
        IO {
            Read: r,
            Write: BufWriter::new(w),
            Error: BufWriter::new(e),
        }
    }
    fn read<T>(&mut self) -> T
    where
        T: std::str::FromStr,
    {
        let next: String = self
            .Read
            .by_ref()
            .bytes()
            .map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect();
        next.parse().ok().unwrap()
    }
    fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
    fn chari(&mut self) -> Vec<i64> {
        self.chars()
            .iter()
            .map(|&c| (c as u8 - b'0') as i64)
            .collect::<Vec<i64>>()
    }
    fn readn<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read::<T>()).collect::<Vec<_>>()
    }
    fn readmat<T: std::str::FromStr>(&mut self, n: usize, m: usize) -> Vec<Vec<T>> {
        (0..n).map(|_| self.readn(m)).collect()
    }
    fn write<S: ToString>(&mut self, val: S) {
        self.Write.write(val.to_string().as_bytes());
    }
    fn writeln<S: ToString>(&mut self, val: S) {
        self.Write.write(val.to_string().as_bytes());
        self.Write.write(b"\n");
    }
    fn debug<S: std::fmt::Debug>(&mut self, val: S) {
        writeln!(self.Error, "(debug) {:?}", &val);
    }
    fn debug2<S: std::fmt::Debug, T: std::fmt::Debug>(&mut self, val1: S, val2: T) {
        writeln!(self.Error, "(debug2) {:?} -> {:?}", val1, val2);
    }
    fn debug3<S: std::fmt::Debug, T: std::fmt::Debug, U: std::fmt::Debug>(
        &mut self,
        val1: S,
        val2: T,
        val3: U,
    ) {
        writeln!(
            self.Error,
            "(debug3) {:?} -> {:?} -> {:?}",
            val1, val2, val3
        );
    }
}


use std::io;

fn main() {
	let mut buf = String::new();
	io::stdin().read_line(&mut buf).expect("");
	let iter = buf.split_whitespace();
	let mut v:Vec<Vec<char>> = Vec::new();
	for i in iter {
		v.push(i.chars().collect::<Vec<char>>());
	}
	let s1 = v[0].clone();
	let s2 = v[1].clone();
	let s3 = v[2].clone();
	let s = format!("{}{}{}", ((s1[0] as u8) + (('z' as u8) - 1)) as char, ((s2[0] as u8) + (('z' as u8) - 1)) as char, ((s3[0] as u8) + (('z' as u8) - 1)) as char);
	println!("{}", s);
}


let i=readLine()!.characters.split(" ").map{String($0).characters.map{String($0)}[0].uppercaseString};print(i[0]+i[1]+i[2])


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main{

	public static void main(String[] args) throws IOException {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer in=new StringTokenizer(br.readLine());
        String S1 =in.nextToken().substring(0, 1);
        String S2 =in.nextToken().substring(0, 1);
        String S3 =in.nextToken().substring(0, 1);
        String ans = S1 + S2 + S3;

        in = null;

		br=null;
		System.out.println(ans.toUpperCase());

	}

}


let w = readLine()!.components(separatedBy: " ").map({$0.prefix(1).uppercased()})

for ch:String in w {
    print(ch, terminator: "")
}


import * as fs from 'fs';

const [s1, s2, s3]: string[] = fs.readFileSync('/dev/stdin', 'utf8').trim().split(' ');

const ans: string = s1.substring(0, 1).toUpperCase() + s2.substring(0, 1).toUpperCase() + s3.substring(0, 1).toUpperCase();
console.log(ans);


const input=require('fs').readFileSync('/dev/stdin', 'utf8').split(/[\s]/);const nin=()=>{const r = input[0];input.shift();return Number(r)};const nrin=(n)=>{const a:number[]=[];rep(n,()=>a.push(nin()));return a};const sin=()=>{const r = input[0];input.shift();return String(r)};const out=(...a)=>{console.log(...a)};const floor=(a)=>{return Math.floor(a)};const abs=(a)=>{return Math.abs(a)};const min=(...a)=>{return Math.min(...a)};const max=(...a)=>{return Math.max(...a)};const rep=(n, callback)=>{for(let i = 0;i < n; i++){callback()}};const strrep=(s, i, v)=>{return s.slice(0, i)+v+s.slice(i+1);};const permutation=({result=[],pre=[],post,n=post.length})=>{if(n>0){post.forEach((_,i)=>{const rest=[...post];const elem=rest.splice(i, 1);permutation({result, pre: [...pre,...elem],post:rest,n:n-1})})}else{result.push(pre)}return result};const sw=(s,a:any[],op:'=='|'>='|'>'|'<='|'<'='==')=>{for(let i=0;i<a.length;i+=2){if(op==='=='){if(s==a[i])return a[i+1]}else if(op==='>='){if(s>=a[i])return a[i+1]}else if(op==='<='){if(s<=a[i])return a[i+1]}else if(op==='>'){if(s>a[i])return a[i+1]}else if(op==='<'){if(s<a[i])return a[i+1]}}return a[a.length-1];};const or=(a,...b)=>{for(let i=0;i<b.length;i++)if(a==b[i])return true;return false};const maxindex=(...a)=>{return a.indexOf(Math.max.apply(null,a))};const asc=(ar:number[])=>{return ar.sort((a,b)=>{return a-b})};const desc=(ar:number[])=>{return ar.sort((a,b)=>{return b-a})};const ceil=a=>{return Math.ceil(a)};const srin=s=>{const a:string[]=[];rep(s,()=>a.push(sin()));return a};let ssinteger=-1;const ssin=()=>{ssinteger++;return input[0][ssinteger]};
const main = ()=>{
  let[a,b,c]=srin(3)
  out((a[0]+b[0]+c[0]).toUpperCase())
}
main()


const main = (input) => {
  input = input.split(' ');
  const A = input[0];
  const B = input[1];
  const C = input[2];

  const bigA = A.toUpperCase();
  const bigB = B.toUpperCase();
  const bigC = C.toUpperCase();
  const result = bigA.slice(0,1)+bigB.slice(0,1)+bigC.slice(0,1);

  console.log(result);
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));


const input=require('fs').readFileSync('/dev/stdin', 'utf8').split(/[\s]/);const nin=()=>{const r = input[0];input.shift();return Number(r)};const nrin=(n)=>{const a:number[]=[];rep(n,()=>a.push(nin()));return a};const sin=()=>{const r = input[0];input.shift();return String(r)};const out=(...a)=>{console.log(...a)};const floor=(a)=>{return Math.floor(a)};const abs=(a)=>{return Math.abs(a)};const min=(...a)=>{return Math.min(...a)};const max=(...a)=>{return Math.max(...a)};const rep=(n, callback)=>{for(let i = 0;i < n; i++){callback()}};const strrep=(s, i, v)=>{return s.slice(0, i)+v+s.slice(i+1);};const permutation=({result=[],pre=[],post,n=post.length})=>{if(n>0){post.forEach((_,i)=>{const rest=[...post];const elem=rest.splice(i, 1);permutation({result, pre: [...pre,...elem],post:rest,n:n-1})})}else{result.push(pre)}return result};const sw=(s,a:any[],op:'=='|'>='|'>'|'<='|'<'='==')=>{for(let i=0;i<a.length;i+=2){if(op==='=='){if(s==a[i])return a[i+1]}else if(op==='>='){if(s>=a[i])return a[i+1]}else if(op==='<='){if(s<=a[i])return a[i+1]}else if(op==='>'){if(s>a[i])return a[i+1]}else if(op==='<'){if(s<a[i])return a[i+1]}}return a[a.length-1];};const or=(a,...b)=>{for(let i=0;i<b.length;i++)if(a==b[i])return true;return false};const maxindex=(...a)=>{return a.indexOf(Math.max.apply(null,a))};const asc=(ar:number[])=>{return ar.sort((a,b)=>{return a-b})};const desc=(ar:number[])=>{return ar.sort((a,b)=>{return b-a})};const ceil=a=>{return Math.ceil(a)};const srin=s=>{const a:string[]=[];rep(s,()=>a.push(sin()));return a};let ssinteger=-1;const ssin=()=>{ssinteger++;return input[0][ssinteger]};
const main = ()=>{
  let[a,b,c]=srin(3)
  out((a[0]+b[0]+c[0]).toLowerCase())
}
main()


const input=require('fs').readFileSync('/dev/stdin', 'utf8').split(/[\s]/);const nin=()=>{const r = input[0];input.shift();return Number(r)};const nrin=(n)=>{const a:number[]=[];rep(n,()=>a.push(nin()));return a};const sin=()=>{const r = input[0];input.shift();return String(r)};const out=(...a)=>{console.log(...a)};const floor=(a)=>{return Math.floor(a)};const abs=(a)=>{return Math.abs(a)};const min=(...a)=>{return Math.min(...a)};const max=(...a)=>{return Math.max(...a)};const rep=(n, callback)=>{for(let i = 0;i < n; i++){callback()}};const strrep=(s, i, v)=>{return s.slice(0, i)+v+s.slice(i+1);};const permutation=({result=[],pre=[],post,n=post.length})=>{if(n>0){post.forEach((_,i)=>{const rest=[...post];const elem=rest.splice(i, 1);permutation({result, pre: [...pre,...elem],post:rest,n:n-1})})}else{result.push(pre)}return result};const sw=(s,a:any[],op:'=='|'>='|'>'|'<='|'<'='==')=>{for(let i=0;i<a.length;i+=2){if(op==='=='){if(s==a[i])return a[i+1]}else if(op==='>='){if(s>=a[i])return a[i+1]}else if(op==='<='){if(s<=a[i])return a[i+1]}else if(op==='>'){if(s>a[i])return a[i+1]}else if(op==='<'){if(s<a[i])return a[i+1]}}return a[a.length-1];};const or=(a,...b)=>{for(let i=0;i<b.length;i++)if(a==b[i])return true;return false};const maxindex=(...a)=>{return a.indexOf(Math.max.apply(null,a))};const asc=(ar:number[])=>{return ar.sort((a,b)=>{return a-b})};const desc=(ar:number[])=>{return ar.sort((a,b)=>{return b-a})};const ceil=a=>{return Math.ceil(a)};const srin=s=>{const a:string[]=[];rep(s,()=>a.push(sin()));return a};let ssinteger=-1;const ssin=()=>{ssinteger++;return input[0][ssinteger]};
const main = ()=>{
  let[a,b,c]=srin(3)
  out((a[0]+b[0]+c[0]).toLowerCase)
}
main()


const input=require('fs').readFileSync('/dev/stdin', 'utf8').split(/[\s]/);const nin=()=>{const r = input[0];input.shift();return Number(r)};const nrin=(n)=>{const a:number[]=[];rep(n,()=>a.push(nin()));return a};const sin=()=>{const r = input[0];input.shift();return String(r)};const out=(...a)=>{console.log(...a)};const floor=(a)=>{return Math.floor(a)};const abs=(a)=>{return Math.abs(a)};const min=(...a)=>{return Math.min(...a)};const max=(...a)=>{return Math.max(...a)};const rep=(n, callback)=>{for(let i = 0;i < n; i++){callback()}};const strrep=(s, i, v)=>{return s.slice(0, i)+v+s.slice(i+1);};const permutation=({result=[],pre=[],post,n=post.length})=>{if(n>0){post.forEach((_,i)=>{const rest=[...post];const elem=rest.splice(i, 1);permutation({result, pre: [...pre,...elem],post:rest,n:n-1})})}else{result.push(pre)}return result};const sw=(s,a:any[],op:'=='|'>='|'>'|'<='|'<'='==')=>{for(let i=0;i<a.length;i+=2){if(op==='=='){if(s==a[i])return a[i+1]}else if(op==='>='){if(s>=a[i])return a[i+1]}else if(op==='<='){if(s<=a[i])return a[i+1]}else if(op==='>'){if(s>a[i])return a[i+1]}else if(op==='<'){if(s<a[i])return a[i+1]}}return a[a.length-1];};const or=(a,...b)=>{for(let i=0;i<b.length;i++)if(a==b[i])return true;return false};const maxindex=(...a)=>{return a.indexOf(Math.max.apply(null,a))};const asc=(ar:number[])=>{return ar.sort((a,b)=>{return a-b})};const desc=(ar:number[])=>{return ar.sort((a,b)=>{return b-a})};const ceil=a=>{return Math.ceil(a)};const srin=s=>{const a:string[]=[];rep(s,()=>a.push(sin()));return a};let ssinteger=-1;const ssin=()=>{ssinteger++;return input[0][ssinteger]};
const main = ()=>{
  let[a,b,c]=srin(3)
  out(a[0]+b[0]+c[0])
}
main()


try:
  n=int(input())
  print((1000-n%1000)%1000)
except EOFError:
  pass


#!/usr/bin/python3
n = int(input())
if(n%1000==0):
	print("0")
else:
	ans = n%1000
	print(1000-ans)


n = int(input())
while n>0:
    n -= 1000

print(-n)


n = int(input())
print((1000-n//1000)%1000)


pay = int(input())

while(pay >=0):
    pay -= 1000
otu = abs(pay)
print(otu)


n=int(input())
if n%1000==0:
  print(0)
elif:
  print(1000-n%1000)


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);

        Problem solver = new Problem();
        solver.solve(0, in, out);
        out.close();
    }

    static class Problem {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int N = in.nextInt();
            if (N % 1000 == 0)
                out.println(0);
            else
                out.println(1000 - (N % 1000));
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}


import java.util.*;
import java.io.*;
import static java.lang.Math.*;

public class Main {
    public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);

		// 入力
		int n = sc.nextInt();

		// 計算
		int result = 0;
		if(n%1000 != 0) result = 1000 - n%1000;

		// 出力
		System.out.println(result);
	}

	public static class Scanner {
		private BufferedReader br; private StringTokenizer tok;
		public Scanner(InputStream is) throws IOException { br = new BufferedReader(new InputStreamReader(is));}
		private void getLine() throws IOException { while(!hasNext()) tok = new StringTokenizer(br.readLine());}
		private boolean hasNext() { return tok != null && tok.hasMoreTokens();}
		public String next() throws IOException { getLine(); return tok.nextToken();}
		public int nextInt() throws IOException { return Integer.parseInt(next());}
		public long nextLong() throws IOException { return Long.parseLong(next());}
		public double nextDouble() throws IOException { return Double.parseDouble(next());}
	}
}


// Utilities
import java.io.*;
import java.util.*;

public class Main {
	static int N;

	public static void main(String[] args) throws IOException {
		N = in.iscan();
		if (N % 1000 == 0) out.println(0);
		else out.println(1000 - (N % 1000));
		out.close();
	}

	static INPUT in = new INPUT(System.in);
	static PrintWriter out = new PrintWriter(System.out);
	private static class INPUT {

		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar, numChars;

		public INPUT (InputStream stream) {
			this.stream = stream;
		}

		public INPUT (String file) throws IOException {
			this.stream = new FileInputStream (file);
		}

		public int cscan () throws IOException {
			if (curChar >= numChars) {
				curChar = 0;
				numChars = stream.read (buf);
			}

			if (numChars == -1)
				return numChars;

			return buf[curChar++];
		}

		public int iscan () throws IOException {
			int c = cscan (), sgn = 1;

			while (space (c))
				c = cscan ();

			if (c == '-') {
				sgn = -1;
				c = cscan ();
			}

			int res = 0;

			do {
				res = (res << 1) + (res << 3);
				res += c - '0';
				c = cscan ();
			}
			while (!space (c));

			return res * sgn;
		}

		public String sscan () throws IOException {
			int c = cscan ();

			while (space (c))
				c = cscan ();

			StringBuilder res = new StringBuilder ();

			do {
				res.appendCodePoint (c);
				c = cscan ();
			}
			while (!space (c));

			return res.toString ();
		}

		public double dscan () throws IOException {
			int c = cscan (), sgn = 1;

			while (space (c))
				c = cscan ();

			if (c == '-') {
				sgn = -1;
				c = cscan ();
			}

			double res = 0;

			while (!space (c) && c != '.') {
				if (c == 'e' || c == 'E')
					return res * UTILITIES.fast_pow (10, iscan ());

				res *= 10;
				res += c - '0';
				c = cscan ();
			}

			if (c == '.') {
				c = cscan ();
				double m = 1;

				while (!space (c)) {
					if (c == 'e' || c == 'E')
						return res * UTILITIES.fast_pow (10, iscan ());

					m /= 10;
					res += (c - '0') * m;
					c = cscan ();
				}
			}

			return res * sgn;
		}

		public long lscan () throws IOException {
			int c = cscan (), sgn = 1;

			while (space (c))
				c = cscan ();

			if (c == '-') {
				sgn = -1;
				c = cscan ();
			}

			long res = 0;

			do {
				res = (res << 1) + (res << 3);
				res += c - '0';
				c = cscan ();
			}
			while (!space (c));

			return res * sgn;
		}

		public boolean space (int c) {
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}
	}

	public static class UTILITIES {

		static final double EPS = 10e-6;

		public static int lower_bound (int[] arr, int x) {
			int low = 0, high = arr.length, mid = -1;

			while (low < high) {
				mid = (low + high) / 2;

				if (arr[mid] >= x)
					high = mid;
				else
					low = mid + 1;
			}

			return low;
		}

		public static int upper_bound (int[] arr, int x) {
			int low = 0, high = arr.length, mid = -1;

			while (low < high) {
				mid = (low + high) / 2;

				if (arr[mid] > x)
					high = mid;
				else
					low = mid + 1;
			}

			return low;
		}

		public static int gcd (int a, int b) {
			return b == 0 ? a : gcd (b, a % b);
		}

		public static int lcm (int a, int b) {
			return a * b / gcd (a, b);
		}

		public static long fast_pow_mod (long b, long x, int mod) {
			if (x == 0) return 1;
			if (x == 1) return b;
			if (x % 2 == 0) return fast_pow_mod (b * b % mod, x / 2, mod) % mod;

			return b * fast_pow_mod (b * b % mod, x / 2, mod) % mod;
		}

		public static int fast_pow (int b, int x) {
			if (x == 0) return 1;
			if (x == 1) return b;
			if (x % 2 == 0) return fast_pow (b * b, x / 2);

			return b * fast_pow (b * b, x / 2);
		}

		public static long choose (long n, long k) {
			k = Math.min (k, n - k);
			long val = 1;

			for (int i = 0; i < k; ++i)
				val = val * (n - i) / (i + 1);

			return val;
		}

		public static long permute (int n, int k) {
			if (n < k) return 0;
			long val = 1;

			for (int i = 0; i < k; ++i)
				val = (val * (n - i));

			return val;
		}
	}
}


import java.util.*;
public class Main{
  public static void main(String[] args)throws Exception{
    Scanner sc=new Sanner(System.in);
    int N=Integer.perseInt(sc.next());
    System.out.println(N%1000);
  }
}


import java.io.*;
import java.util.*;

public class Main {
    private static final boolean N_CASE = false;

    private void solve() {
        int n = sc.nextInt();
        out.println(1000 - (n % 1000));
    }

    private void run() {
        int T = N_CASE ? sc.nextInt() : 1;
        for (int t = 0; t < T; ++t) {
            solve();
        }
    }

    private static MyWriter out;
    private static MyScanner sc;

    private static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        private MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        int[] nextIntArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = nextInt();
            }
            return a;
        }

        int[][] nextIntArray(int n, int m) {
            int[][] a = new int[n][m];
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < m; j++) {
                    a[i][j] = sc.nextInt();
                }
            }
            return a;
        }

        long[] nextLongArray(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++) {
                a[i] = nextLong();
            }
            return a;
        }

        long[][] nextLongArray(int n, int m) {
            long[][] a = new long[n][m];
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < m; j++) {
                    a[i][j] = nextLong();
                }
            }
            return a;
        }

        List<Integer> nextList(int n) {
            List<Integer> list = new ArrayList<>();
            for (int i = 0; i < n; i++) {
                list.add(nextInt());
            }
            return list;
        }

        List<Long> nextLongList(int n) {
            List<Long> list = new ArrayList<>();
            for (int i = 0; i < n; i++) {
                list.add(nextLong());
            }
            return list;
        }

        char[] nextCharArray(int n) {
            return sc.next().toCharArray();
        }

        char[][] nextCharArray(int n, int m) {
            char[][] c = new char[n][m];
            for (int i = 0; i < n; i++) {
                String s = sc.next();
                for (int j = 0; j < m; j++) {
                    c[i][j] = s.charAt(j);
                }
            }
            return c;
        }
    }

    private static class MyWriter extends PrintWriter {
        private MyWriter(OutputStream outputStream) {
            super(outputStream);
        }

        void printArray(int[] a) {
            for (int i = 0; i < a.length; ++i) {
                print(a[i]);
                print(i == a.length - 1 ? '\n' : ' ');
            }
        }

        void printArray(long[] a) {
            for (int i = 0; i < a.length; ++i) {
                print(a[i]);
                print(i == a.length - 1 ? '\n' : ' ');
            }
        }

        void println(int[] a) {
            for (int v : a) {
                println(v);
            }
        }

        void print(List<Integer> list) {
            for (int i = 0; i < list.size(); ++i) {
                print(list.get(i));
                print(i == list.size() - 1 ? '\n' : ' ');
            }
        }

        void println(List<Integer> list) {
            list.forEach(this::println);
        }
    }

    private <T> List<List<T>> createGraph(int n) {
        List<List<T>> g = new ArrayList<>();
        for (int i = 0; i < n; ++i) {
            g.add(new ArrayList<>());
        }
        return g;
    }

    private void fill(int[][] a, int value) {
        for (int[] row : a) {
            fill(row, value);
        }
    }

    private void fill(int[] a, int value) {
        Arrays.fill(a, value);
    }

    public static void main(String[] args) {
        out = new MyWriter(new BufferedOutputStream(System.out));
        sc = new MyScanner();
        new Main().run();
        out.close();
    }
}


import java.io.*;
import java.util.*;

public class Main {
    private static final boolean N_CASE = false;

    private void solve() {
        int n = sc.nextInt();
        out.println(n % 1000);
    }

    private void run() {
        int T = N_CASE ? sc.nextInt() : 1;
        for (int t = 0; t < T; ++t) {
            solve();
        }
    }

    private static MyWriter out;
    private static MyScanner sc;

    private static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        private MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        int[] nextIntArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = nextInt();
            }
            return a;
        }

        int[][] nextIntArray(int n, int m) {
            int[][] a = new int[n][m];
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < m; j++) {
                    a[i][j] = sc.nextInt();
                }
            }
            return a;
        }

        long[] nextLongArray(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++) {
                a[i] = nextLong();
            }
            return a;
        }

        long[][] nextLongArray(int n, int m) {
            long[][] a = new long[n][m];
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < m; j++) {
                    a[i][j] = nextLong();
                }
            }
            return a;
        }

        List<Integer> nextList(int n) {
            List<Integer> list = new ArrayList<>();
            for (int i = 0; i < n; i++) {
                list.add(nextInt());
            }
            return list;
        }

        List<Long> nextLongList(int n) {
            List<Long> list = new ArrayList<>();
            for (int i = 0; i < n; i++) {
                list.add(nextLong());
            }
            return list;
        }

        char[] nextCharArray(int n) {
            return sc.next().toCharArray();
        }

        char[][] nextCharArray(int n, int m) {
            char[][] c = new char[n][m];
            for (int i = 0; i < n; i++) {
                String s = sc.next();
                for (int j = 0; j < m; j++) {
                    c[i][j] = s.charAt(j);
                }
            }
            return c;
        }
    }

    private static class MyWriter extends PrintWriter {
        private MyWriter(OutputStream outputStream) {
            super(outputStream);
        }

        void printArray(int[] a) {
            for (int i = 0; i < a.length; ++i) {
                print(a[i]);
                print(i == a.length - 1 ? '\n' : ' ');
            }
        }

        void printArray(long[] a) {
            for (int i = 0; i < a.length; ++i) {
                print(a[i]);
                print(i == a.length - 1 ? '\n' : ' ');
            }
        }

        void println(int[] a) {
            for (int v : a) {
                println(v);
            }
        }

        void print(List<Integer> list) {
            for (int i = 0; i < list.size(); ++i) {
                print(list.get(i));
                print(i == list.size() - 1 ? '\n' : ' ');
            }
        }

        void println(List<Integer> list) {
            list.forEach(this::println);
        }
    }

    private <T> List<List<T>> createGraph(int n) {
        List<List<T>> g = new ArrayList<>();
        for (int i = 0; i < n; ++i) {
            g.add(new ArrayList<>());
        }
        return g;
    }

    private void fill(int[][] a, int value) {
        for (int[] row : a) {
            fill(row, value);
        }
    }

    private void fill(int[] a, int value) {
        Arrays.fill(a, value);
    }

    public static void main(String[] args) {
        out = new MyWriter(new BufferedOutputStream(System.out));
        sc = new MyScanner();
        new Main().run();
        out.close();
    }
}


#include <iostream>
using namespace std;
int main()
{
    int N;
    cin >> N;
    if(N%1000==0)
    {
        cout<<0<<endl;
    }
    else
    {
        cout<<(1000-N%1000)<<endl;
    }
    return 0;
}


#include <stdio.h>

int main (){
   int n;
   int m;
   scanf("%d", &n);

   for(m = 0; m<n;m += 1000){
   }
   printf("%d", m-n);
return 0;
}


#include <stdio.h>
#include <string.h>

int main()
{
	int N;
	scanf("%d", &N);

	int x = (N + 999) / 1000 * 1000;
	printf("%d\n", x - N);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
#define all(x) x.begin(),x.end()
#define rep(i,j,n) for (long long i = j; i < (long long)(n); i++)
#define _GLIBCXX_DEBUG
#define MOD 1000000007
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
//(a+b-1)/b

signed main(){
	int n;
    cin >> n ;
  cout <<(n + 1000 - 1)/1000 << endl;

	return 0;
}


ソースコード

Copy
Copy
#include<bits/stdc++.h>
using namespace std;

int main(){
  int N;
  cin >> N;
  if(N%1000==0){
    cout << "0" << endl;
    return 0;
  }
  cout << 1000-N%1000 << endl;
  return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main(){
  int N;
  cin >> N;
  if(N%1000==0){
    cout << "0" << endl;
    return 0;
  }
  cout << 1000-N%1000 << endl;
  return 0;


#include<stdio.h>
int main(){
  int x;
  scanf("%d",&x);
  printf("%d",(x/1000+(x%1000!=0))*1000-x);
}


#include <stdio.h>
int main (){
  int N=0,i=0;
  scanf("%d",&N);
  for(i=0;N>=1000;i++){
    N=N-1000;
  }
  N=1000-N;
  if(N==1000){
    N=0;
  }
  printf("%d",N);
}


#include <stdio.h>
main(){
  int N = 0;
  int t = 0;
  int i = 0;
  scanf("%d", &N);
  i = 1000;
  while (i < N){
    i = i + 1000;
  }
  t = i - N;
  printf("%d", t);
}


#include<stdio.h>
#include<string.h>

int main()
{
    int k,n,s;
    scanf("%d",&n);
    k=n%1000;
    k=1000-k;
    printf("%d",k);
    return 0;
}


#include <stdio.h>

int main()
{
  int N;
  scanf("%d",&N);
  int ans = N%1000;

  if(ans = 0){
    printf("%d", 0);
  }else{
    printf("%d",1000-ans);
  }

    return 0;
}


const main = (input) => {
  const change = (answer) => {
    const temp = parseInt(answer, 10);
    if (temp === 0) {
      return 0;
    } else {
      return 1000 - temp;
    }
  };

  const N = input.trim().split("");
  if (N.length <= 3) {
    console.log(change(N.join("")));
  } else {
    let answer = "";
    let cnt = 0;

    while (cnt < 3) {
      answer = N.pop() + answer;
      cnt++;
    }

    console.log(change(answer));
  }
};

main(require("fs").readFileSync("/dev/stdin", "utf8"));


const main = (input) => {
  const n = Number(input)
  if(n % 1000 === 0) {
    console.log(0)
  } else {
    console.log(1000 - (n % 1000))
  }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'))


function main(input) {
  console.log(Math.ceil(input / 1000) * 1000 - input);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


function Main(input) {
  input = input.split("\n");
  const N = parseInt(input[0]);

  let answer;
  if (N % 1000 === 0) {
    answer = 0;
  } else {
    answer = N % 1000;
  }

  console.log(answer);

}
// デバッグ用
function debug() {
  var input = document.getElementById("input").value;
  Main(input);
}

//* この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


const main = stdin => {
  const N = parseInt(stdin.trim())
  console.log(1000 - N % 1000)
}

// 標準入力
main(require("fs").readFileSync("/dev/stdin", "utf8"))


const main = (stdin) => {
    const input = Number(stdin)
    console.log(input % 1000)
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));


package main

import "fmt"

func main() {
	var n int
	fmt.Scan(&n)
	mod := n % 1000
	change := mod
	if mod != 0 {
		change = 1000 - mod
	}
	fmt.Println(change)
}


//go:generate echo "https://atcoder.jp/contests/abc173/tasks/abc173_a"
package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
	"strconv"
)

type scanner struct{ *bufio.Scanner }

func newScanner(r io.Reader) *scanner {
	s := bufio.NewScanner(r)
	s.Split(bufio.ScanWords)
	s.Buffer(nil, 100000000)
	return &scanner{s}
}

func (s *scanner) Int() int {
	s.Scan()
	n, _ := strconv.Atoi(s.Text())
	return n
}

func (s *scanner) Ints(l int) []int {
	if l == 0 {
		return []int{}
	}
	sl := make([]int, l, l)
	for i := range sl {
		sl[i] = s.Int()
	}
	return sl
}

func solve(N int) int {
	return (1000 - N%1000) % 1000
}

func run(r io.Reader, w io.Writer) {
	scan := newScanner(r)
	fmt.Fprintln(w, solve(scan.Int()))
}

func main() {
	run(os.Stdin, os.Stdout)
}


package main

import "fmt"

func main() {
  var n int
  fmt.Scan(&n)
  i := 0
  for true {
    i+= 1
    if 1000 * i >= n {
      ans := 1000 * i - n
      fmt.Println(ans)
      break
    }
  }
}


package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scan(&n)

	fmt.Println(1000 - n%1000)
}


package main

import (
	"fmt"
)

func main() {
	var N int
	fmt.Scan(&N)

	var change int = N % 1000
	fmt.Println(change)
}


package main

import (
	"fmt"
)

func main() {
	var N int
	fmt.Scan(&N)

	change := N % 1000
	fmt.Println(change)
}


n = gets.to_i
ans = 1000 - n % 1000
puts ans == 1000 ? 0 : ans


n = gets.to_i

if n % 1000 == 0
  puts 0
else
  puts 1000 - (n % 1000)
end


ans = 1000 - (gets.chomp.to_i % 1000)
puts ans == 1000 ? 0 : ans


n = gets.chars.map(&:to_i)
change = 1000 - n[-3,3].join.to_i

if change == 1000
  puts 0
else
  puts change
end


n = gets.chomp.to_i
#p n
ans = n % 1000
ans == 0 ? 0 : 1000 - ans
p ans


n = gets.to_i
ac = wa = tle = re = 0

n.times do
  case gets.strip
    when 'AC' then ac += 1
    when 'WA' then wa += 1
    when 'TLE' then tle += 1
    when 'RE' then re += 1
  end
end

puts "AC x #{ac}"
puts "WA x #{wa}"
puts "TLE x #{tle}"
puts "RE x #{re}"


use proconio::input;

fn main() {
    input! {
        n: i32, // 購入金額
    }

    let m = n % 1000;
    println!("{}", if m == 0 { m } else { 1000 - m });
}


use itertools::interleave;
use itertools::join;
use proconio::input;
use proconio::marker::Chars;

use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};
use std::io::Write;

pub trait Echo {
    fn echo(&self);
    fn echo_b(&self, out: &mut std::io::Stdout) -> Result<(), std::io::Error>;
}

macro_rules! impl_echo {
    ($($t:ty),*) => {
        $(
            impl Echo for $t {
                fn echo(&self){
                    self.echo_b(&mut std::io::stdout()).unwrap();
                }

                fn echo_b(&self, out: &mut std::io::Stdout) -> Result<(), std::io::Error>{
                    writeln!(out,"{}", &self)?;
                    Ok(())
                }
            }
        )*
    };
}

macro_rules! impl_echo_f {
    ($($t:ty),*) => {
        $(
            impl Echo for $t {
                fn echo(&self){
                    self.echo_b(&mut std::io::stdout()).unwrap();
                }

                fn echo_b(&self, out: &mut std::io::Stdout) -> Result<(), std::io::Error>{
                    writeln!(out,"{:.12}", &self)?;
                    Ok(())
                }
            }
        )*
    };
}

impl_echo!(u8, u16, u32, u64, u128, usize);
impl_echo!(i8, i16, i32, i64, i128, isize);
impl_echo!(&str, String, char);
impl_echo_f!(f32, f64);

impl<T: Echo> Echo for Vec<T> {
    fn echo(&self) {
        self.echo_b(&mut std::io::stdout()).unwrap();
    }
    fn echo_b(&self, out: &mut std::io::Stdout) -> Result<(), std::io::Error> {
        for i in self {
            i.echo_b(out).unwrap();
        }
        Ok(())
    }
}

fn main() {
    input! {
        n: usize
    };
    let res = if n % 1000 == 0 { 0 } else { 1000 - n % 1000 };
    res.echo();
}

#[allow(dead_code)]
fn yn(i: bool) {
    if i {
        println!("Yes");
    } else {
        println!("No");
    }
}


#![allow(unused_imports, unused_macros)]

use kyoproio::*;
use std::{
    collections::*,
    io::{self, prelude::*},
    iter,
    mem::{replace, swap},
};

fn main() -> io::Result<()> {
    std::thread::Builder::new()
        .stack_size(64 * 1024 * 1024)
        .spawn(|| {
            let stdin = io::stdin();
            let stdout = io::stdout();
            run(KInput::new(stdin.lock()), io::BufWriter::new(stdout.lock()))
        })?
        .join()
        .unwrap();
    Ok(())
}

fn run<I: Input, O: Write>(mut kin: I, mut out: O) {
    macro_rules! output { ($($args:expr),+) => { write!(&mut out, $($args),+).unwrap(); }; }
    macro_rules! outputln {
        ($($args:expr),+) => { output!($($args),+); outputln!(); };
        () => { output!("\n"); if cfg!(debug_assertions) { out.flush().unwrap(); } }
    }

    let n: i32 = kin.input();
    outputln!("{}", (10000 - n) % 1000);
}

// -----------------------------------------------------------------------------
pub mod kyoproio {
    use std::io::prelude::*;
    pub trait Input {
        fn str(&mut self) -> &str;
        fn input<T: InputParse>(&mut self) -> T {
            T::input(self)
        }
        fn iter<T: InputParse>(&mut self) -> Iter<T, Self> {
            Iter(self, std::marker::PhantomData)
        }
        fn seq<T: InputParse, B: std::iter::FromIterator<T>>(&mut self, n: usize) -> B {
            self.iter().take(n).collect()
        }
    }
    pub struct KInput<R> {
        src: R,
        buf: String,
        pos: usize,
    }
    impl<R: BufRead> KInput<R> {
        pub fn new(src: R) -> Self {
            Self {
                src,
                buf: String::with_capacity(1024),
                pos: 0,
            }
        }
    }
    impl<R: BufRead> Input for KInput<R> {
        fn str(&mut self) -> &str {
            loop {
                if self.pos >= self.buf.len() {
                    self.pos = 0;
                    self.buf.clear();
                    if self.src.read_line(&mut self.buf).expect("io error") == 0 {
                        return &self.buf;
                    }
                }
                let range = self.pos
                    ..self.buf[self.pos..]
                        .find(|c: char| c.is_ascii_whitespace())
                        .map(|i| i + self.pos)
                        .unwrap_or_else(|| self.buf.len());
                self.pos = range.end + 1;
                if range.end > range.start {
                    return &self.buf[range];
                }
            }
        }
    }
    pub struct Iter<'a, T, I: ?Sized>(&'a mut I, std::marker::PhantomData<*const T>);
    impl<'a, T: InputParse, I: Input + ?Sized> Iterator for Iter<'a, T, I> {
        type Item = T;
        fn next(&mut self) -> Option<T> {
            Some(self.0.input())
        }
    }
    pub trait InputParse: Sized {
        fn input<I: Input + ?Sized>(src: &mut I) -> Self;
    }
    impl InputParse for Vec<u8> {
        fn input<I: Input + ?Sized>(src: &mut I) -> Self {
            src.str().as_bytes().to_owned()
        }
    }
    macro_rules! from_str_impl {
        { $($T:ty)* } => {
            $(impl InputParse for $T {
                fn input<I: Input + ?Sized>(src: &mut I) -> Self {
                    src.str().parse::<$T>().expect("parse error")
                }
            })*
        }
    }
    from_str_impl! {
        String char bool f32 f64 isize i8 i16 i32 i64 i128 usize u8 u16 u32 u64 u128
    }
    macro_rules! tuple_impl {
        ($H:ident $($T:ident)*) => {
            impl<$H: InputParse, $($T: InputParse),*> InputParse for ($H, $($T),*) {
                fn input<I: Input + ?Sized>(src: &mut I) -> Self {
                    ($H::input(src), $($T::input(src)),*)
                }
            }
            tuple_impl!($($T)*);
        };
        () => {}
    }
    tuple_impl!(A B C D E F G);
    #[macro_export]
    macro_rules! kdbg {
        ($($v:expr),*) => {
            if cfg!(debug_assertions) { dbg!($($v),*) } else { ($($v),*) }
        }
    }
}


//【ライブラリここから】
// 1. 入力の容易化（https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8）
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}
//【ライブラリここまで】

fn main() {
    input! {n: i32};
    println!("{}", 1000 - n % 1000);
}


//【ライブラリここから】
// 1. 入力の容易化（https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8）
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}
//【ライブラリここまで】

fn main() {
    input! {n: i32};
    println!("{}", n % 1000);
}


use proconio::{fastout, input};
#[fastout]
fn main() {
    input! {mut n:usize};
    n %= 1000;

    println!({}, n == 0 : n ? 1000 - n);
}


let n = Int(readLine()!)!
var pay = 0
while pay < n {
  pay += 1000
}
print(pay - n)


let N = Int(readLine()!)!
print(N % 1000 == 0 ? 0 : 1000 - (N % 1000))


let a = Int(readLine()!)!
if a%1000 == 0 {
  print(0)} else {
print(1000 - a%1000)
}


import Foundation

let input_line: String = readLine()!
let split: [String] = input_line.components(separatedBy: " ")

let N = Double(split[0])!

print(Int(ceil(N/1000)) - Int(N))


import Foundation

let input_line: String = readLine()!
let split: [String] = input_line.components(separatedBy: " ")

let N = Double(split[0])!

print(Int(ceil(N/1000))-N)


func readInt() -> Int {
    return Int(readLine()!)!
}

func main() {
    let price = readInt()
    let payment = price % 1000 == 0 ? price / 1000 : price / 1000 * 1
    let exchange = payment - price
    print(exchange)
    return
}


{
  const Main = (input: string) => {
    const n = parseInt(input.trim())
    console.log(Math.ceil(n / 1000) * 1000 - n)
  };

  Main(require("fs").readFileSync("/dev/stdin", "utf8"));
}


import * as fs from "fs";

const input: string = fs.readFileSync("/dev/stdin", "utf8");
let num: number = parseInt(input);

console.log(num % 1000 == 0 ? 0 : 1000 - num % 1000);


import { readFileSync } from 'fs'

function main(input: string) {
  const n = Number(input)

  const base = 1000
  const result = Math.ceil(n / base) * base - n

  console.log(result)
}

main(readFileSync('/dev/stdin', 'utf8').trim())


import * as fs from "fs";

const input: string = fs.readFileSync("/dev/stdin", "utf8");
let num: number = parseInt(input);

console.log(1000 - num % 1000);


"use strict";

const main = (arg: string) => {
  const input: string = arg.trim();

  let x = parseInt(input)

  while (x >= 1000) {
    x %= 1000
  }

  console.log(x)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


import * as fs from "fs";

// inputで受け取り配列化する
const input = fs.readFileSync("/dev/stdin", "utf8");

console.log(1000 - (Number(input) % 1000));


data = input().split()
r = int(data[0])
g = int(data[1])
b = int(data[2])

num = 10*g + b

if(num % 4 == 0):
	print("YES")
else:
	print("NO")


print("YES" if eval(input().replace(" ",""))%4 == 0 else "NO")


r, g, b = input().split()
if int(r + g + b) % 4 == 0:
    print('YES')
else:
    print('NO')


N = int("".join(map(str,input().split())))
print(("No","Yes")[N % 4 == 0])


r, g, b = map(int, input().split())
num = 10*y + z
if num % 4 == 0:
  print("YES")
else:
  print("NO")


r, g, b = map(int, input().split())

N = r * 100 + g * 10 + b

if N % 4 == 0:
    print("Yes")
else:
    print("No")


import java.io.IOException;
import java.io.InputStream;
import java.util.NoSuchElementException;

public class Main {
  public static void main(String[] args) {
    FastScanner sc = new FastScanner();
    int v = sc.nextInt() * 100 + sc.nextInt() * 10 + sc.nextInt();
    System.out.println(v % 4 == 0 ? "YES" : "NO");
  }

}

class FastScanner {
	public static String debug = null;

	private final InputStream in = System.in;
	private int ptr = 0;
	private int buflen = 0;
	private byte[] buffer = new byte[1024];
	private boolean eos = false;

	private boolean hasNextByte() {
		if (ptr < buflen) {
			return true;
		} else {
			ptr = 0;
			try {
				if (debug != null) {
					buflen = debug.length();
					buffer = debug.getBytes();
					debug = "";
					eos = true;
				} else {
					buflen = in.read(buffer);
				}
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (buflen < 0) {
				eos = true;
				return false;
			} else if (buflen == 0) {
				return false;
			}
		}
		return true;
	}

	private int readByte() {
		if (hasNextByte())
			return buffer[ptr++];
		else
			return -1;
	}

	private static boolean isPrintableChar(int c) {
		return 33 <= c && c <= 126;
	}

	private void skipUnprintable() {
		while (hasNextByte() && !isPrintableChar(buffer[ptr]))
			ptr++;
	}

	public boolean isEOS() {
		return this.eos;
	}

	public boolean hasNext() {
		skipUnprintable();
		return hasNextByte();
	}

	public String next() {
		if (!hasNext())
			throw new NoSuchElementException();
		StringBuilder sb = new StringBuilder();
		int b = readByte();
		while (isPrintableChar(b)) {
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	public long nextLong() {
		if (!hasNext())
			throw new NoSuchElementException();
		long n = 0;
		boolean minus = false;
		int b = readByte();
		if (b == '-') {
			minus = true;
			b = readByte();
		}
		if (b < '0' || '9' < b) {
			throw new NumberFormatException();
		}
		while (true) {
			if ('0' <= b && b <= '9') {
				n *= 10;
				n += b - '0';
			} else if (b == -1 || !isPrintableChar(b)) {
				return minus ? -n : n;
			} else {
				throw new NumberFormatException();
			}
			b = readByte();
		}
	}

	public int nextInt() {
		return (int) nextLong();
	}

	public long[] nextLongList(int n) {
		return nextLongTable(1, n)[0];
	}

	public int[] nextIntList(int n) {
		return nextIntTable(1, n)[0];
	}

	public long[][] nextLongTable(int n, int m) {
		long[][] ret = new long[n][m];
		for (int i = 0; i < n; i ++) {
			for (int j = 0; j < m; j ++) {
				ret[i][j] = nextLong();
			}
		}
		return ret;
	}

	public int[][] nextIntTable(int n, int m) {
		int[][] ret = new int[n][m];
		for (int i = 0; i < n; i ++) {
			for (int j = 0; j < m; j ++) {
				ret[i][j] = nextInt();
			}
		}
		return ret;
	}
}


import java.io.IOException;
import java.io.InputStream;
import java.util.NoSuchElementException;

public class Main {
	private static FastScanner sc = new FastScanner();

	public static void main(String[] args) {
		int r = sc.nextInt();
		int g = sc.nextInt();
		int b = sc.nextInt();
		if((g%2 == 0 && b%4 == 0) || (g%2 == 1 && b%4 == 2)) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	}

	static class FastScanner {
        private final InputStream in = System.in;
        private final byte[] buffer = new byte[1024];
        private int ptr = 0;
        private int buflen = 0;
        private boolean hasNextByte() {
            if(ptr < buflen) {
                return true;
            } else {
                ptr = 0;
                try {
                    buflen = in.read(buffer);
                } catch(IOException e) {
                    e.printStackTrace();
                }
                if(buflen <= 0) {
                    return false;
                }
            }
            return true;
        }
        private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
        private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
        private void skipUnprintable() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;}
        public boolean hasNext() { skipUnprintable(); return hasNextByte();}
        public String next() {
            if (!hasNext()) throw new NoSuchElementException();
            StringBuilder sb = new StringBuilder();
            int b = readByte();
            while(isPrintableChar(b)) {
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb.toString();
        }
        public long nextLong() {
            return Long.parseLong(next());
        }
        public int nextInt(){
            return Integer.parseInt(next());
        }
        public double nextDouble(){
            return Double.parseDouble(next());
        }
    }
}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Main
{
	public static void main(String[] args)throws IOException
	{

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String card[] = br.readLine().split(" ");
		int sum = 0;
		sum = (Integer.parseInt(card[1]))*10 + (Integer.parseInt(card[2]));
		if(sum % 4 == 0) System.out.println("YES");
		else System.out.println("NO");

	}
}


import java.util.*;
import java.io.*;

public class Main {
    static class FS {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer("");

        String next() {
            while (!st.hasMoreTokens())
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        int[] readArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        public long[] readLongArray(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        }
    }

    static final FS sc = new FS();
    static final PrintWriter out = new PrintWriter(System.out);
    static final int mod = 1000000007;

    public static void main(String[] args) {

        solve();
        out.close();

    }

    static void solve() {
        int a = sc.nextInt();
        if (a % 4 == 0){
            out.println("Yes");
        }
        else {
            out.println("No");
        }
    }
}


import java.util.Scanner;

public class Main {

	static Scanner scanner;

	public static void main(String[] args) {
	    scanner = new Scanner(System.in);

	    int N=gi();
	    String S=gs();

	    int s=0;
	    int e=0;
	    int sc=0;
	    for (int i=0; i<N;i++) {
	    	char c=S.charAt(i);
	    	if(c=='(') {
	    		s++;
	    	} else {
	    		e++;
	    	}
	    	sc=Math.max(sc, e-s);
	    }

	    int s2=0;
	    int e2=0;
	    int ec=0;
	    for (int i=N-1; i>=0;i--) {
	    	char c=S.charAt(i);
	    	if(c=='(') {
	    		s2++;
	    	} else {
	    		e2++;
	    	}
	    	ec=Math.max(ec, s2-e2);
	    }

	    StringBuilder sb=new StringBuilder();
	    for(int i=0; i<sc;i++) {
	    	sb.append('(');
	    }
	    sb.append(S);
	    for(int i=0; i<ec;i++) {
	    	sb.append(')');
	    }
	    String ns=sb.toString();

        System.out.println(ns);
	}

	public static class Edge {
	    private int from;
	    private int to;
	    private long cost;

	    public Edge(int f, int t, long c) {
	    	this.from=f;
	    	this.to=t;
	    	this.cost=c;
	    }

	    public int gfrom() {
	    	return from;
	    }

	    public int gto() {
	    	return to;
	    }

	    public long gcost() {
	    	return cost;
	    }

	    public void sfrom(int f) {
	    	from=f;
	    }

	    public void sto(int t) {
	    	to=t;
	    }

	    public void scost(int c) {
	    	cost=c;
	    }
	}
	// 文字列として入力を取得
	public static String gs() {
		return scanner.next();
	}

	// intとして入力を取得
	public static int gi() {
		return Integer.parseInt(scanner.next());
	}

	// longとして入力を取得
	public static long gl() {
		return Long.parseLong(scanner.next());
	}

	// doubleとして入力を取得
	public static double gd() {
		return Double.parseDouble(scanner.next());
	}
}


import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int r = sc.nextInt();
        int g = sc.nextInt();
        int b = sc.nextInt();

        if (((r * 100 ) + (g * 10) + b ) % 4 == 0) {
          System.out.println("Yes");
        }
        else {
          System.out.println("No");
        }
    }
}


#include <stdio.h>

int main(){
    int a, b, c;
    scanf("%d%d%d", &a, &b, &c);
    if((100*a+10*b+c)%4) printf("NO");
    else printf("YES");
    return 0;
}


#include <stdio.h>

int main() {
    int r, g, b;
    scanf("%d %d %d", &r, &g, &b);
    printf("%s\n", (100*r+10*g+b) % 4 == 0 ? "YES" : "NO");
}


// Copyright 2017 wu_qing
#include <cstdio>
int a, b, c, tot;
int main() {
    scanf("%d%d%d", &a, &b, &c);
    tot = a * 100 + b *10 + c;
    if (tot % 4 == 0)
        printf("YES\n");
    else
        printf("NO\n");
    return 0;
}


#include <iostream>
using namespace std;
int main()
{
  int r, g, b;
  cin >> r >> g >> b;
  if ((r*100+g+10+b)%4==0) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}


#include <iostream>
using namespace std;
int main()
{
  int r, g, b;
  cin >> r >> g >> b;
  if ((r*100+g+10+b)%4==0) {
    cout << "YES" << endl;
  } else {
    cout << "NO" endl;
  }
  return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
 int H, W;
 int seen[10000][10000];
  char S[10000][10000];
vector<pair<ll, ll>> prime_factorize(ll n) { //素因数分解と各素数の個数
    vector<pair<ll, ll>> res;

    for (ll i = 2; i * i <= n; i++)
    {
        if (n % i != 0)
        {
            continue;
        }
        int num = 0;

        while (n % i == 0)
        {
            ++num;
            n /= i;
        }
        res.push_back(make_pair(i, num));

    }
     if (n != 1)
        {
            res.push_back(make_pair(n, 1));
        }
        return res;

}
long long GCD(long long a, long long b) {
    if (b == 0) return a;
    else return GCD(b, a % b);
}
ll lcm(ll x, ll y) {
    return x / GCD(x, y) * y;//先に割り算をして掛けられる数を小さくして掛け算を行う
}
const int MAX = 510000;
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

void dfs(int st, int fi) {
  //  cout << st << " " << fi <<  endl;
    if (st < 0 || fi < 0 || st >= H || fi >= W)
    {
        return ;
    }
    if (S[st][fi] == '#')
    {
        return ;
    }

    if (seen[st][fi] == 1)
    {
        return ;
    }

    if (S[st][fi] == '.')
    {
        seen[st][fi] = 1;
    }

    dfs(st + 1, fi);
    dfs(st, fi + 1);
    dfs(st, fi - 1);
    dfs(st - 1, fi);

}
int main() {
 int N;
 cin >> N;
 vector<int> a(N), sum(9);
 for(int i = 0; i < N; i++) {
     cin >> a[i];
 }
 int ans = 0;
 for (int i = 0; i < N; i++)
 {
     //cout << 1 << endl;
    if (a[i] >= 1 && a[i] <= 399)
    {

        sum[0]++;

    }else if (a[i] >= 400 && a[i] <= 799)
    {
        sum[1]++;

    }else if (a[i] >= 800 && a[i] <= 1199)
    {
        sum[2]++;

    }else if (a[i] >= 1200 && a[i] <= 1599)
    {
        sum[3]++;

    }else if (a[i] >= 1600 && a[i] <= 1999)
    {
        sum[4]++;

    }else if (a[i] >= 2000 && a[i] <= 2399)
    {
        sum[5]++;

    }else if (a[i] >= 2400 && a[i] <= 2799)
    {
        sum[6]++;

    }else if (a[i] >= 2800 && a[i] <= 3199)
    {
        sum[7]++;

    }else
    {
        sum[8]++;
    }

 }
 for (int i = 0; i < 8; i++)
 {
    if(sum[i] >= 1) ans += 1;
 }
 if (ans == 0)
 {
     cout << 1 << " " << sum[8] << endl;
     return 0;
 }

 cout << ans << " " << ans + sum[8] << endl;
    return 0;

}


#include <stdio.h>
#include <stdlib.h>
#include <time.h>

int main() {
	int a, b, c;
	scanf("%d%d%d",&a,&b,&c);
	c=(a*100+b*10+c)%4;
	if (!c)printf("YES\n");
	else printf("NO\n");
	return 0;
}


#include <stdio.h>
#include <stdlib.h>

int main(void){
    //int r,g,b;
    char r,g,b;
    char str[4];

    scanf("%c %c %c", &r,&g,&b);

    //printf("%c", (char)r);

    str[0]=r;
    str[1]=g;
    str[2]=b;

    //printf("%s\n", str);

    if((atoi(str))%4==0){
        printf("YES\n");
    }else{
        printf("NO\n");
    }

    return 0;
}


#include<stdio.h>
int main(void) {
	int n, m;
	scanf("%d", &n);
	scanf("%d%d", &n, &m);
	(n * 10 + m) % 4 == 0 ? printf("YES") : printf("NO");
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main() {
    int a, b, c;
    cin >> a >> b >> c;
    int re = (100 * a) + (10 * b) + c;

    if (re % 4 == 0) {
        cout << "YES" << endl;
    } else {
        cout << "NO" << endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main() {
    int a, b, c;
    cin >> a >> b >> c;
    int re = (100 * a) + (10 * b) + c;

    if (re % 4 == 0) {
        cout << "YES" << endl;
    } else {
        cout << "NO" << endl;
    }
    return 0;
}


#include <stdio.h>
int main() {
  int a, b, c;
  scanf("%d %d %d", &a, &b, &c);
  (((a*100)+(b*10)+c)%4==0)?printf("YES\n");:printf("NO\n");
}


'use strict'

function main(s) {
  let n = s.split('\n')[0].split(' ');
  let target = Number(n[1]+n[2]);
  //console.log(target);
  let ans = target % 4 === 0? 'YES':'NO';
  console.log(ans);
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));


function Main(input) {
  const num = input.split(" ").join("");
  console.log(num % 4 === 0 ? "YES" : "NO");
}
Main(require("fs").readFileSync("/dev/stdin","utf8"));


function Main(input) {
	input = input.trim().split(" ").join("");
  console.log((parseInt(input) % 4 == 0) ? "YES" : "NO");

}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));


function main(input){
  input = input.split(' ');
  var r = input[0];
  var g = input[1];
  var b = input[2];
  var num = (r * 100) + (g * 10) +  b;
  if(num % 4 === 0){
    console.log('YES');
  }else{
    console.log('NO');
  }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


let [, g, b] = require("fs").readFileSync("/dev/stdin", "utf8").split(" ").map(Number);
console.log((g * 10 + b) % 4 == 0 ? "YES" : "No");


let [r, g, b] = require("fs").readFileSync("/dev/stdin", "utf8").split(" ");
console.log(Number(r + g + b) % 4 == 0 ? "YES" : "No");


package main

import "fmt"

func main() {
	var r, g, b int
	fmt.Scan(&r, &g, &b)

	ans := r * 100 + g * 10 + b
	if ans % 4 == 0 {
		fmt.Println("YES")
		return
	}
	fmt.Println("NO")
}


package main

import (
	"bufio"
	"container/heap"
	"fmt"
	"math"
	"os"
	"strconv"
)

const (
	initialBufSize = 10000
	maxBufSize     = 1000000
	mod            = 1e9 + 7
)

var (
	sc *bufio.Scanner = func() *bufio.Scanner {
		sc := bufio.NewScanner(os.Stdin)
		buf := make([]byte, initialBufSize)
		sc.Buffer(buf, maxBufSize)
		sc.Split(bufio.ScanWords)
		return sc
	}()
)

func main() {
	r := getInt()
	g := getInt()
	b := getInt()

	number, _ := strconv.Atoi(fmt.Sprintf("%d%d%d", r, g, b))

	if number % 4 == 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

type Graph struct {
	n     int
	edges [][]int
}

func NewGraph(n int) *Graph {
	g := &Graph{
		n:     n,
		edges: make([][]int, n),
	}
	return g
}

func (g *Graph) AddEdge(u, v int) {
	g.edges[v] = append(g.edges[v], u)
	g.edges[u] = append(g.edges[u], v)
}

func dfs(c int, edges [][]int, visited map[int]struct{}) {
	visited[c] = struct{}{}

	for _, v := range edges[c] {
		_, flag := visited[v]
		if flag {
			continue
		}
		dfs(v, edges, visited)
	}
}

func bfs(c int, graph *Graph) {
	next := make([]int, 0)
	next = append(next, c)
	visited := make(map[int]struct{})

	for ; len(next) != 0; {
		u := next[0]
		next = next[1:]
		visited[u] = struct{}{}

		for _, v := range graph.edges[u] {
			_, flag := visited[v]
			if flag {
				continue
			}

			// なにか処理

			next = append(next, v)
		}
	}
}

func getInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func getIntArray(n int) []int {
	array := make([]int, n)
	for i := 0; i < n; i++ {
		array[i] = getInt()
	}
	return array
}

func getString() string {
	sc.Scan()
	return sc.Text()
}

func getStringArray(n int) []string {
	array := make([]string, n)
	for i := 0; i < n; i++ {
		array[i] = getString()
	}
	return array
}

func abs(a int) int {
	return int(math.Abs(float64(a)))
}

func pow(p, q int) int {
	return int(math.Pow(float64(p), float64(q)))
}

func powMod(n, p int) int {
	if p == 0 {
		return 1
	} else if p%2 == 0 {
		t := powMod(n, p/2)
		return calcMod(t * t)
	} else {
		return calcMod(n * powMod(n, p-1))
	}
}

func min(nums ...int) int {
	if len(nums) == 0 {
		panic("funciton min() requires at least one argument.")
	}
	res := nums[0]
	for i := 0; i < len(nums); i++ {
		res = int(math.Min(float64(res), float64(nums[i])))
	}
	return res
}

func max(nums ...int) int {
	if len(nums) == 0 {
		panic("funciton max() requires at least one argument.")
	}
	res := nums[0]
	for i := 0; i < len(nums); i++ {
		res = int(math.Max(float64(res), float64(nums[i])))
	}
	return res
}

func strSearch(a []string, b string) bool {
	for i := 0; i < len(a); i++ {
		if a[i] == b {
			return true
		}
	}
	return false
}

func printIntArray(array []int) {
	strArray := fmt.Sprint(array)
	fmt.Println(strArray[1 : len(strArray)-1])
}

func calcMod(x int) int {
	return x % mod
}

func reverse(s string) string {
	runes := []rune(s)
	for i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {
		runes[i], runes[j] = runes[j], runes[i]
	}
	return string(runes)
}

func isPrime(n int) bool {
	if n < 2 {
		return false
	} else if n == 2 {
		return true
	} else if n % 2 == 0 {
		return false
	}

	sqrtN := int(math.Sqrt(float64(n)))
	for i := 3; i <= sqrtN; i += 2 {
		if n % i == 0 {
			return false
		}
	}

	return true
}

func contains(s []int, e int) bool {
	for _, v := range s {
		if e == v {
			return true
		}
	}
	return false
}

func makeRange(min, max int) []int {
	a := make([]int, max-min+1)
	for i := range a {
		a[i] = min + i
	}
	return a
}

func powerset2(nums []int) [][]int {
	length := int(math.Pow(2, float64(len(nums))))
	result := make([][]int, length)

	index := 0
	result[index] = []int{}
	index++

	for _, n := range nums {
		max := index
		for i := 0; i < max; i++ {
			result[index] = copyAndAppend(result[i], n)
			index++
		}
	}

	return result
}

func copyAndAppend(nums []int, n int) []int {
	dst := make([]int, len(nums)+1)
	copy(dst, nums)
	dst[len(nums)] = n
	return dst
}

func calcGcd(x, y int) int {
	if y == 0 {
		return x
	} else if x >= y {
		return calcGcd(y, x % y)
	} else {
		return calcGcd(x, y % x)
	}
}

func getDivisor(n int) []int {
	var divisor []int
	divisor = append(divisor, 1)
	if n != 1 {
		divisor = append(divisor, n)
	}

	sqrt := int(math.Sqrt(float64(n)))
	for i := 2; i <= sqrt; i++ {
		if n % i == 0 {
			divisor = append(divisor, i)
			divisor = append(divisor, n/i)
		}
	}
	return divisor
}

type intHeap []int

func (h intHeap) Len() int {
	return len(h)
}

func (h intHeap) Less(i, j int) bool {
	return h[i] > h[j]
}

func (h intHeap) Swap(i, j int) {
	h[i], h[j] = h[j], h[i]
}

func (h *intHeap) Push(x interface{}) {
	*h = append(*h, x.(int))
}

func (h *intHeap) Pop() interface{} {
	old := *h
	n := len(old)
	x := old[n-1]
	*h = old[0 : n-1]
	return x
}

func initHeap() *intHeap {
	ih := &intHeap{}
	heap.Init(ih)
	return ih
}

func (h *intHeap) pushHeap(n int) {
	heap.Push(h, n)
}

func (h *intHeap) popHeap() int {
	return heap.Pop(h).(int)
}

func factMod(n int) int {
	value := 1
	for ; n > 1; n-- {
		value = calcMod(value * n)
	}
	return value
}

func combinationMod(n, k int) int {
	factN := factMod(n)
	factK := factMod(k)
	factNK := factMod(n - k)
	factKR := powMod(factK, mod - 2)
	factNKR := powMod(factNK, mod - 2)
	return calcMod(factN * calcMod(factKR * factNKR))
}


package main

import "fmt"

func main() {
	var r, g, b int
	fmt.Scan(&r, &g, &b)
	if (100*r+10*g+b)%4 == 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}


package main

import "fmt"

func main() {
	var r, g, b int
	fmt.Scan(&r, &g, &b)

	if (100*4+10*g+b)/4 == 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}


package main

import (
	"fmt"
)

func main() {
	var r, g, b int
	fmt.Scan(&r, &g, &b)
	rgb := r*100 + b*10 + g
	if rgb%4 == 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}

}


package main

import (
	"bufio"
	"container/heap"
	"fmt"
	"math"
	"os"
	"strconv"
)

const (
	initialBufSize = 10000
	maxBufSize     = 1000000
	mod            = 1e9 + 7
)

var (
	sc *bufio.Scanner = func() *bufio.Scanner {
		sc := bufio.NewScanner(os.Stdin)
		buf := make([]byte, initialBufSize)
		sc.Buffer(buf, maxBufSize)
		sc.Split(bufio.ScanWords)
		return sc
	}()
)

func main() {
	r := getInt()
	g := getInt()
	b := getInt()

	number, _ := strconv.Atoi(fmt.Sprintf("%d%d%d", r, g, b))

	if number % 3 == 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

type Graph struct {
	n     int
	edges [][]int
}

func NewGraph(n int) *Graph {
	g := &Graph{
		n:     n,
		edges: make([][]int, n),
	}
	return g
}

func (g *Graph) AddEdge(u, v int) {
	g.edges[v] = append(g.edges[v], u)
	g.edges[u] = append(g.edges[u], v)
}

func dfs(c int, edges [][]int, visited map[int]struct{}) {
	visited[c] = struct{}{}

	for _, v := range edges[c] {
		_, flag := visited[v]
		if flag {
			continue
		}
		dfs(v, edges, visited)
	}
}

func bfs(c int, graph *Graph) {
	next := make([]int, 0)
	next = append(next, c)
	visited := make(map[int]struct{})

	for ; len(next) != 0; {
		u := next[0]
		next = next[1:]
		visited[u] = struct{}{}

		for _, v := range graph.edges[u] {
			_, flag := visited[v]
			if flag {
				continue
			}

			// なにか処理

			next = append(next, v)
		}
	}
}

func getInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func getIntArray(n int) []int {
	array := make([]int, n)
	for i := 0; i < n; i++ {
		array[i] = getInt()
	}
	return array
}

func getString() string {
	sc.Scan()
	return sc.Text()
}

func getStringArray(n int) []string {
	array := make([]string, n)
	for i := 0; i < n; i++ {
		array[i] = getString()
	}
	return array
}

func abs(a int) int {
	return int(math.Abs(float64(a)))
}

func pow(p, q int) int {
	return int(math.Pow(float64(p), float64(q)))
}

func powMod(n, p int) int {
	if p == 0 {
		return 1
	} else if p%2 == 0 {
		t := powMod(n, p/2)
		return calcMod(t * t)
	} else {
		return calcMod(n * powMod(n, p-1))
	}
}

func min(nums ...int) int {
	if len(nums) == 0 {
		panic("funciton min() requires at least one argument.")
	}
	res := nums[0]
	for i := 0; i < len(nums); i++ {
		res = int(math.Min(float64(res), float64(nums[i])))
	}
	return res
}

func max(nums ...int) int {
	if len(nums) == 0 {
		panic("funciton max() requires at least one argument.")
	}
	res := nums[0]
	for i := 0; i < len(nums); i++ {
		res = int(math.Max(float64(res), float64(nums[i])))
	}
	return res
}

func strSearch(a []string, b string) bool {
	for i := 0; i < len(a); i++ {
		if a[i] == b {
			return true
		}
	}
	return false
}

func printIntArray(array []int) {
	strArray := fmt.Sprint(array)
	fmt.Println(strArray[1 : len(strArray)-1])
}

func calcMod(x int) int {
	return x % mod
}

func reverse(s string) string {
	runes := []rune(s)
	for i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {
		runes[i], runes[j] = runes[j], runes[i]
	}
	return string(runes)
}

func isPrime(n int) bool {
	if n < 2 {
		return false
	} else if n == 2 {
		return true
	} else if n % 2 == 0 {
		return false
	}

	sqrtN := int(math.Sqrt(float64(n)))
	for i := 3; i <= sqrtN; i += 2 {
		if n % i == 0 {
			return false
		}
	}

	return true
}

func contains(s []int, e int) bool {
	for _, v := range s {
		if e == v {
			return true
		}
	}
	return false
}

func makeRange(min, max int) []int {
	a := make([]int, max-min+1)
	for i := range a {
		a[i] = min + i
	}
	return a
}

func powerset2(nums []int) [][]int {
	length := int(math.Pow(2, float64(len(nums))))
	result := make([][]int, length)

	index := 0
	result[index] = []int{}
	index++

	for _, n := range nums {
		max := index
		for i := 0; i < max; i++ {
			result[index] = copyAndAppend(result[i], n)
			index++
		}
	}

	return result
}

func copyAndAppend(nums []int, n int) []int {
	dst := make([]int, len(nums)+1)
	copy(dst, nums)
	dst[len(nums)] = n
	return dst
}

func calcGcd(x, y int) int {
	if y == 0 {
		return x
	} else if x >= y {
		return calcGcd(y, x % y)
	} else {
		return calcGcd(x, y % x)
	}
}

func getDivisor(n int) []int {
	var divisor []int
	divisor = append(divisor, 1)
	if n != 1 {
		divisor = append(divisor, n)
	}

	sqrt := int(math.Sqrt(float64(n)))
	for i := 2; i <= sqrt; i++ {
		if n % i == 0 {
			divisor = append(divisor, i)
			divisor = append(divisor, n/i)
		}
	}
	return divisor
}

type intHeap []int

func (h intHeap) Len() int {
	return len(h)
}

func (h intHeap) Less(i, j int) bool {
	return h[i] > h[j]
}

func (h intHeap) Swap(i, j int) {
	h[i], h[j] = h[j], h[i]
}

func (h *intHeap) Push(x interface{}) {
	*h = append(*h, x.(int))
}

func (h *intHeap) Pop() interface{} {
	old := *h
	n := len(old)
	x := old[n-1]
	*h = old[0 : n-1]
	return x
}

func initHeap() *intHeap {
	ih := &intHeap{}
	heap.Init(ih)
	return ih
}

func (h *intHeap) pushHeap(n int) {
	heap.Push(h, n)
}

func (h *intHeap) popHeap() int {
	return heap.Pop(h).(int)
}

func factMod(n int) int {
	value := 1
	for ; n > 1; n-- {
		value = calcMod(value * n)
	}
	return value
}

func combinationMod(n, k int) int {
	factN := factMod(n)
	factK := factMod(k)
	factNK := factMod(n - k)
	factKR := powMod(factK, mod - 2)
	factNKR := powMod(factNK, mod - 2)
	return calcMod(factN * calcMod(factKR * factNKR))
}


r, g, b = gets.chomp.split(" ").map{|i| i.to_s}
if (r+g+b).to_i % 4 == 0
  puts "YES"
else
  puts "NO"
end


puts gets.split(' ').join.to_i % 4 == 0 ? 'YES' : 'NO'


io = STDIN
r,b,g=io.gets.chomp.split.map(&:to_i)
if (r*100+b*10+g)%4 == 0
  puts 'YES'
else
  puts 'NO'
end


cols = gets.chomp.split(' ').map(&:to_i).sort
if (cols[1].to_s + cols[2].to_s).to_i % 4 == 0
  puts "YES"
else
  puts "NO"
end


rgb = gets.to_i

if rgb % 4 == 0
  print "YES"
else
  print "NO"
end


input = gets.chomp.split.chars.join.to_i

if input % 4 == 0
  puts "YES"
else
  puts "NO"
end


macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input!{
        r: u32,
        g: u32,
        b: u32,
    };
    println!("{}", if (g * 10 + b) % 4 == 0 {"YES"} else {"NO"});
}


use std::io;

fn procon_read<T: std::str::FromStr>() ->  Vec<T> {
	let mut buf = String::new();
	io::stdin().read_line(&mut buf).expect("");
	let iter = buf.split_whitespace();
	let mut v: Vec<T> = Vec::new();
	for i in iter {
		v.push(i.parse().ok().unwrap());
	}
	v
}

fn main() {
	let v:Vec<i32> = procon_read();
	let r = v[0];
	let g = v[1];
	let b = v[2];
	let s = format!("{}{}{}", r, g, b);
	let i : i32 = s.parse().ok().unwrap();
	if i%4 == 0 {
		println!("YES");
	}else{
		println!("NO");
	}
}


macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};
    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };
    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };
    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };
    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };
    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        r: u32,
        g: u32,
        b: u32,
    }
    if (100*r + 10*g + b) % 4 == 0 {
        println!("YES");
    } else {
        println!("NO");
    }
}


use proconio::input;
fn main (){
let mut _a: i128;
let mut _b: i128;
let mut _c: i128;

input! {
    _a: i128,
    b: i128,
    c: i128,

}

let x = (b*10) + c ;

if x % 4 == 0  {
    println!("Yes");
}else {
    println!("No");

}

}


use proconio::input;
fn main (){
let mut _a: i128;
let mut _b: i128;
let mut _c: i128;

input! {
    a: i128,
    b: i128,
    c: i128,

}

let x = (b*10) + c ;

if x % 4 == 0  {
    println!("Yes");
}else {
    println!("No");

}

}


use proconio::{input, fastout};

#[fastout]
fn main() {
    input! {
        n: usize,
        an: [usize; n]
    };

    println!("{}", an.iter().max().unwrap() - an.iter().min().unwrap());
}


print(Int(readLine()!.characters.split(" ").map{String($0)}.joinWithSeparator(""))!%4>0 ?"NO":"YES")


let i=readLine()!.characters.split(" ").map{Int(String($0))!};print((i[1]*10+i[2])%4>0 ?"NO":"YES")


print(Int(readLine()!.characters.split(" ").joinWithSeparator(""))!%4>0 ?"NO":"YES")


print(Int(readLine()!.characters.split(" ").joinWithSeparator())!%4>0 ?"NO":"YES")


print(Int(readLine.characters.split(" ").joinWithSeparator())!%4>0 ?"NO":"YES")


import * as fs from 'fs';

const [r, g, b]: string[] = fs.readFileSync('/dev/stdin', 'utf8').trim().split(' ');
const num: number = parseInt(r + g + b, 10);
const ans: string = (num % 4 === 0) ? 'YES' : 'NO';
console.log(ans);


const log = console.log;

function Main(input: string): void {
  const num = parseInt(input.replace(/\s/g, ""));

  log((num & 0b11) === 0 ? "YES" : "NO");
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));


var input: string = require('fs').readFileSync('/dev/stdin', 'utf8');
var inputLines: string[] = input.trim().split("\n");
var parts = inputLines[0].split(" ");

var threeDigit = parseInt(parts[0] + parts[1] + parts[2]);
console.log(threeDigit % 4 == 0 ? "YES" : "NO");


function Main(input) {
    input = input.split('\n');
    var num = Number(input[0].split(' ').join(''))
    console.log(num % 4 === 0 ? 'Yes' : 'No');

}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));


const main = (input) => {
  input = input.split(' ');
  const r = parseInt(input[0], 10);
  const g = parseInt(input[1], 10);
  const b = parseInt(input[2], 10);

  if (r+g+b%4==0){
    console.log("YES");
  }else{
    console.log("NO");
  }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


const main = (input) => {
  input = input.split(' ');
  const r = parseInt(input[0], 10);
  const g = parseInt(input[1], 10);
  const b = parseInt(input[2], 10);

  if (r*100+g*10+b%4==0){
    console.log("YES");
  }else{
    console.log("NO");
  }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


s = input()
print(700+100*s.count('o'))


s=input()
print(700+100*s.count('o'))


a_price,b_price,ab_price,num_a,num_b = map(int, input().split())
total = 0

if a_price + b_price < 2 * ab_price:
	total = a_price * num_a + b_price * num_b

elif a_price + b_price >= 2 * ab_price:
	if num_a >= num_b:
		if a_price > ab_price * 2:
			total = ab_price * 2 * num_a
		else:
			total = ab_price * 2 * num_b + a_price * (num_a - num_b)
	else:
		if b_price > ab_price * 2:
			total = ab_price * 2 * num_b
		else:
			total = ab_price * 2 * num_a + b_price * (num_b - num_a)

print(total)


S = input()
price = 700 + 100*s.count('o')
print(price)


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
    private static final BufferedReader input = new BufferedReader(new InputStreamReader(System.in));

    public static void main(String[] args) {
        String str = readLineStandardInput();
        char[] S = str.toCharArray();
        int y = 700;
        for(char s: S){
            if(s == 'o'){
                y += 100;
            }
        }
        System.out.println(y);
    }

    private static String readLineStandardInput() {
        String str;
        try {
            str = input.readLine();
        } catch(IOException e){
            str = null;
            System.out.println(e);
        }
        return str;
    }
}


import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.util.NoSuchElementException;

public class Main {

	static PrintWriter out;
	static InputReader ir;
	static boolean debug = false;

	static void solve() {
		char[] s = ir.next().toCharArray();
		int res = 700;
		for (char c : s)
			if (c == 'o')
				res += 100;
		out.println(res);
	}

	public static void main(String[] args) {
		ir = new InputReader(System.in);
		out = new PrintWriter(System.out);
		solve();
		out.flush();
	}

	static class InputReader {

		private InputStream in;
		private byte[] buffer = new byte[1024];
		private int curbuf;
		private int lenbuf;

		public InputReader(InputStream in) {
			this.in = in;
			this.curbuf = this.lenbuf = 0;
		}

		public boolean hasNextByte() {
			if (curbuf >= lenbuf) {
				curbuf = 0;
				try {
					lenbuf = in.read(buffer);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (lenbuf <= 0)
					return false;
			}
			return true;
		}

		private int readByte() {
			if (hasNextByte())
				return buffer[curbuf++];
			else
				return -1;
		}

		private boolean isSpaceChar(int c) {
			return !(c >= 33 && c <= 126);
		}

		private void skip() {
			while (hasNextByte() && isSpaceChar(buffer[curbuf]))
				curbuf++;
		}

		public boolean hasNext() {
			skip();
			return hasNextByte();
		}

		public String next() {
			if (!hasNext())
				throw new NoSuchElementException();
			StringBuilder sb = new StringBuilder();
			int b = readByte();
			while (!isSpaceChar(b)) {
				sb.appendCodePoint(b);
				b = readByte();
			}
			return sb.toString();
		}

		public int nextInt() {
			if (!hasNext())
				throw new NoSuchElementException();
			int c = readByte();
			while (isSpaceChar(c))
				c = readByte();
			boolean minus = false;
			if (c == '-') {
				minus = true;
				c = readByte();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res = res * 10 + c - '0';
				c = readByte();
			} while (!isSpaceChar(c));
			return (minus) ? -res : res;
		}

		public long nextLong() {
			if (!hasNext())
				throw new NoSuchElementException();
			int c = readByte();
			while (isSpaceChar(c))
				c = readByte();
			boolean minus = false;
			if (c == '-') {
				minus = true;
				c = readByte();
			}
			long res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res = res * 10 + c - '0';
				c = readByte();
			} while (!isSpaceChar(c));
			return (minus) ? -res : res;
		}

		public double nextDouble() {
			return Double.parseDouble(next());
		}

		public int[] nextIntArray(int n) {
			int[] a = new int[n];
			for (int i = 0; i < n; i++)
				a[i] = nextInt();
			return a;
		}

		public long[] nextLongArray(int n) {
			long[] a = new long[n];
			for (int i = 0; i < n; i++)
				a[i] = nextLong();
			return a;
		}

		public char[][] nextCharMap(int n, int m) {
			char[][] map = new char[n][m];
			for (int i = 0; i < n; i++)
				map[i] = next().toCharArray();
			return map;
		}
	}

	static void tr(Object... o) {
		if (debug)
			out.println(Arrays.deepToString(o));
	}
}


import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.NoSuchElementException;
import java.util.Random;

class Main {
	public static void main(String[] args) {
		new Main().run();
	}

	void run() {
		FastScanner sc=new FastScanner();
		PrintWriter pw=new PrintWriter(System.out);
		char[] cs=sc.next().toCharArray();
		int ans=700;
		for(char c:cs) if(c=='o')ans+=100;
		pw.println(ans);
		pw.close();
	}

	static void tr(Object... objects) {
		System.out.println(Arrays.deepToString(objects));
	}

}

class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        }else{
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
    private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
    private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
    public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}
    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    public int nextInt() {
    	return Integer.parseInt(next());
    }

    public long nextLong() {
    	return Long.parseLong(next());
    }
}


import java.util.*;

public class Main {

	public static  void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		int count = 0;
		int y = 700;
		for(int i = 0; i < 3; i++)
		{
			if(S == "o")
			{
				count ++;
			}
			else if(S == "x")
			{

			}
		}
		y = y + (100 * count);
		System.out.println(y);
	}

}


import java.io.IOException;
import java.util.Scanner;

public class HalfAndHalf {
    public static void main(String[] Arguments) throws IOException
    {
        Scanner sc = new Scanner(System.in);
        long A = sc.nextInt(), B = sc.nextInt(), C = sc.nextInt(), X = sc.nextInt(), Y = sc.nextInt();

        // Cost of Buying A and B Pizzas separately:
        long costAB = A * X + B * Y;

        // Common Number of A and B Pizzas
        long Same = Math.min(X, Y);
        X = X - Same;
        Y = Y - Same;
        long costCombine = Same * 2 * C + A * X + B * Y;
        long totalCost = Same * 2 * C + Math.max(X, Y) * 2 * C;

        // Is it better to buy A and B Pizzas Seperately, or should he use AB Pizzas?
        long Best = Math.min(costAB, costCombine);
        Best = Math.min(Best, totalCost);
        System.out.println(Best);
    }
}


public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    int total = 0;
    total += 700;
    for(int i = 0; i<3; i++){
      if(s.charAt(i) == 'o'){
        total += 100;
      }
    }
    System.out.println(total);
  }
}


#include<stdio.h>
int main() {
    int ans = 700;
    char a[4];
    scanf("%s", a);
    int i;
    for (i = 0; i < 3; i++)
    {
        if (a[i] == 'o')
            ans += 100;
    }
    printf("%d\n", ans);
    return 0;
}


#include <stdio.h>

int main(void)
{
	char a[4]={0}, c=0;

	scanf("%s" ,&a[1]);

	for(int i=1; i<=3; i++)
		if(a[i]=='o') c++;

	printf("%d\n" ,700+c*100);
	return 0;
}


#include<cstdio>
#include<cmath>
#include<algorithm>
#include<string>
#include<cstring>
using namespace std;

int main()
{
	char a[3];
	int ans = 0;
	scanf("%c%c%c",&a[0],&a[1],&a[2]);
	for(int i = 0; i < 3; i++) {
		if(a[i] == 'o') ans++;
	}
	printf("%d\n", 700 + ans*100);
}


#include <iostream>
#include <cmath>
#include <iomanip>

using namespace std;

int main() {
	string s;
	cin >> s;
	int t = 0;
	if (s[0] == '◦') t += 100;
	if (s[1] == '◦') t += 100;
	if (s[2] == '◦') t += 100;
	cout << 700 + t << endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define All(a) (a).begin(),(a).end()

int main(){
  int a,b,c,x,y;
  ll ans=0;
  cin >> a>> b>>c>>x>>y;
  if(a+b<2*c){
    cout<<a*x+b*y<<endl;
    return 0;
  }else{
    int tmp=min(x,y);
    x-=tmp;y-=tmp;
    ans+=c*tmp*2;

    if(x>0 && a>2*c){
      ans+=x*c*2;
      x=0;
    }else if(y>0 && b>2*c){
      ans+=y*c*2;
      y=0;
    }else{
      ans+=a*x+b*y;
    }
    cout << ans <<endl;
  }

  return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define All(a) (a).begin(),(a).end()

int main(){
  int a,b,c,x,y;
  ll ans=0;
  cin >> a>> b>>c>>x>>y;
  if(a+b<2*c){
    cout<<a*x+b*y<<endl;
    return 0;
  }else{
    int tmp=min(x,y);
    x-=tmp;y-=tmp;
    ans+=c*tmp*2;

    if(x>0 && a>2*c){
      ans+=x*c*2;
      x=0;
    }
    else if(y>0 && b>2*c){
      ans+=y*c*2;
      y=0;
    }
    else ans+=a*x+b*y;
    cout << ans <<endl;
  }

  return 0;
}


#include<stdio.h>
int main(){
  char s[128];
  scanf("%s",s);
  int count=0;
  int i;
  for(i=0;i<3;i++){
    if(s[i]=='o'){
      count++;
    }
  }
  printf("%d",700+count*100);
}


#include <stdio.h>
#include <stdlib.h>

int main(void) {
	char topping[3];
	int sum = 700;
	int i;

	scanf("%s", topping);

	for(i = 0; i < 3; i++){
		if(topping[i] == 'o'){
			sum += 100;
		}
	}

	printf("%d", sum);

	return 0;
}


#include <stdio.h>

int main(void){
	int n=700;
	char a[10];
	scanf("%s", &a);
	for(int i=0; i<3; i++){
		if(a[i]=='o') n = n + 100;
	}
	printf("%d", n);
}


#include<stdio.h>
#include<string.h>
int main()
{
    char s[3];
    gets(s);
    int len,i,cnt=0;
    len = strlen(s);
    for(i=0;i<len;i++){
        if(s[i]=='o')
            cnt++;
    }
    printf("%d\n",700+cnt*100);
    return 0;

}