package main

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

//Util
func nextStr() string {
	sc.Scan()
	return sc.Text()
}

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

func maxInt(a, b int) int {
	if a > b {
		return a
	} else {
		return b
	}
}

func minInt(a, b int) int {
	if a > b {
		return b
	} else {
		return a
	}
}

func absInt(a int) int {
	if a >= 0 {
		return a
	} else {
		return -a
	}
}

func absFloat64(a float64) float64 {
	if a >= 0 {
		return a
	} else {
		return -a
	}
}

func maxFloat64(a, b float64) float64 {
	if a > b {
		return a
	} else {
		return b
	}
}

func minFloat64(a, b float64) float64 {
	if a > b {
		return b
	} else {
		return a
	}
}

func str2Int(s string) int {
	n, _ := strconv.Atoi(s)
	return n
}

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 powInt(p, q int) int {
	return int(math.Pow(float64(p), float64(q)))
}

func isPrime(x int) bool {
	if x == 1 {
		return false
	}
	if x == 2 {
		return true
	}
	if x%2 == 0 {
		return false
	}

	b := true
	rootx := int(math.Sqrt(float64(x)))
	i := 3
	for i <= rootx {
		if x%i == 0 {
			b = false
			break
		}
		i += 2
	}
	return b
}

func PrimeFactors(n int) (pfs []int) {
	// Get the number of 2s that divide n
	for n%2 == 0 {
		pfs = append(pfs, 2)
		n = n / 2
	}

	// n must be odd at this point. so we can skip one element
	// (note i = i + 2)
	for i := 3; i*i <= n; i = i + 2 {
		// while i divides n, append i and divide n
		for n%i == 0 {
			pfs = append(pfs, i)
			n = n / i
		}
	}

	// This condition is to handle the case when n is a prime number
	// greater than 2
	if n > 2 {
		pfs = append(pfs, n)
	}

	return
}

func PrimeFactorsMap(n int) map[int]int {
	pfs := map[int]int{}
	// Get the number of 2s that divide n
	for n%2 == 0 {
		if _, ok := pfs[2]; ok {
			pfs[2]++
		} else {
			pfs[2] = 1
		}
		//pfs = append(pfs, 2)
		n = n / 2
	}

	// n must be odd at this point. so we can skip one element
	// (note i = i + 2)
	for i := 3; i*i <= n; i = i + 2 {
		// while i divides n, append i and divide n
		for n%i == 0 {
			if _, ok := pfs[i]; ok {
				pfs[i]++
			} else {
				pfs[i] = 1
			}
			n = n / i
		}
	}

	// This condition is to handle the case when n is a prime number
	// greater than 2
	if n > 2 {
		if _, ok := pfs[n]; ok {
			pfs[n]++
		} else {
			pfs[n] = 1
		}
	}

	return pfs
}

func sumInts(x []int) int {

	total := 0
	for _, v := range x {
		total += v
	}

	return total
}

func swap(a int, b int) (int, int) {
	return b, a
}

func gcd(a, b int) int {
	if b == 0 {
		return a
	}
	return gcd(b, a%b)
}

func lcm(a, b int) int {

	return a / b * gcd(a, b)

}

//Main
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)
		return sc
	}()
)

func main() {
	sc.Split(bufio.ScanWords)
	N := nextInt()
	if N == 1 {
		fmt.Println(nextStr())
		return
	}
	memo := make([][]int, N)
	for i := 0; i < N; i++ {
		memo[i] = make([]int, 26)
	}

	for i := 0; i < N; i++ {
		s := nextStr()
		for j := 0; j < len(s); j++ {
			memo[i][s[j]-97]++
			//fmt.Println(s[j], string(s[j]))
		}
	}

	buf := bufio.NewWriter(os.Stdout)
	for i := 0; i < 26; i++ {
		min := N
		for j := 0; j < N; j++ {
			min = minInt(min, memo[j][i])
		}
		for j := 0; j < min; j++ {
			//fmt.Println(string(i + 97))
			buf.Write([]byte(fmt.Sprintf("%s", string(i+97))))
		}
	}
	buf.Write([]byte("\n"))
	buf.Flush()
}


package main

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

var sc = bufio.NewScanner(os.Stdin)

func Scan() string {
	sc.Scan()
	return sc.Text()
}
func iScan() int {
	n, _ := strconv.Atoi(Scan())
	return n
}
func fScan() float64 {
	n, _ := strconv.ParseFloat(Scan(), 64)
	return n
}
func stringToInt(s string) int {
	n, _ := strconv.Atoi(s)
	return n
}
func SScan(n int) []string {
	a := make([]string, n)
	for i := 0; i < n; i++ {
		a[i] = Scan()
	}
	return a
}
func iSScan(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = iScan()
	}
	return a
}
func abs(x int) int {
	if x < 0 {
		x = -x
	}
	return x
}
func larger(a, b int) int {
	if a < b {
		return b
	} else {
		return a
	}
}
func smaller(a, b int) int {
	if a > b {
		return b
	} else {
		return a
	}
}
func max(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x < a[i] {
			x = a[i]
		}
	}
	return x
}
func min(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x > a[i] {
			x = a[i]
		}
	}
	return x
}
func sum(a []int) int {
	x := 0
	for _, v := range a {
		x += v
	}
	return x
}

// UnionFind 構造体 for tree
type UnionFind struct {
	par []int
}

/*コンストラクタ*/
func newUnionFind(N int) *UnionFind {
	u := new(UnionFind)
	u.par = make([]int, N)
	for i := range u.par {
		u.par[i] = -1
	}
	return u
}
func (u UnionFind) root(x int) int {
	if u.par[x] < 0 {
		return x
	}
	u.par[x] = u.root(u.par[x])
	return u.par[x]
}
func (u UnionFind) unite(x int, y int) {
	xr := u.root(x)
	yr := u.root(y)
	if xr == yr {
		return
	}
	u.par[yr] += u.par[xr]
	u.par[xr] = yr
}
func (u UnionFind) same(x, y int) bool {
	if u.root(x) == u.root(y) {
		return true
	}
	return false
}
func (u UnionFind) size(x int) int {
	return -u.par[u.root(x)]
}

var mod int = 1000000007

type pair struct {
	fi int
	se int
}

func main() {
	buf := make([]byte, 0)
	sc.Buffer(buf, mod)
	sc.Split(bufio.ScanWords)
	//予備
	a := iScan()
	b := iScan()
	c := iScan()

	if b-a == c-a {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}


package main

import (
	"fmt"
)

func main() {
	var a, b, c int
	fmt.Scan(&a, &b, &c)

	if b-a == c-b {
		fmt.Println("YES")
	} else {
		fmt.Println("YES")
	}
}


a,b,c = gets.chomp.split(' ').map(&:to_i)
if b-a == c-b
  puts "YES"
else
  puts "NO"
end


a,b,c = gets.split.map(&:to_i)
puts b - a == c - b ? "YES" : "NO"


a, b, c = gets.split(" ").map(&:to_i)
puts ((b - a) == (c - b) ? "YES" : "NO")


a,b,c = map(int, input().split())
if b-a==c-b:
  print("YES")
else:
  print("NO")


a=gets.split.map(&:to_i).sort;puts a[0] + a[1] == a[2] ? "YES" : "NO"


def l(a, b, c)
  puts b - a == c - b ? "YES" : "No"
end

a, b, c= gets.chomp.split(" ").map(&:to_i)
l(a, b, c)


#[allow(unused_macros, dead_code)]
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)*}
    };
}

#[allow(unused_macros, dead_code)]
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)*}
    };

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

#[allow(unused_macros, dead_code)]
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, bytes) => {
        read_value!($next, String).into_bytes()
    };

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

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

#[allow(dead_code)]
struct UnionFind {
    parent: Vec<usize>,
    rank: Vec<usize>,
    size: Vec<usize>,
}

#[allow(dead_code)]
impl UnionFind {
    fn new(n: usize) -> UnionFind {
        let mut p = vec![0; n];
        for i in 0..n {
            p[i] = i;
        }
        return UnionFind {
            parent: p,
            rank: vec![0; n],
            size: vec![1; n],
        };
    }

    fn find(&mut self, x: usize) -> usize {
        if x == self.parent[x] {
            x
        } else {
            let p = self.parent[x];
            let pr = self.find(p);
            self.parent[x] = pr;
            pr
        }
    }

    fn same(&mut self, a: usize, b: usize) -> bool {
        self.find(a) == self.find(b)
    }

    fn unite(&mut self, a: usize, b: usize) {
        let a_root = self.find(a);
        let b_root = self.find(b);
        if a_root == b_root {
            return;
        }
        if self.rank[a_root] > self.rank[b_root] {
            self.parent[b_root] = a_root;
            self.size[a_root] += self.size[b_root];
        } else {
            self.parent[a_root] = b_root;
            self.size[b_root] += self.size[a_root];
            if self.rank[a_root] == self.rank[b_root] {
                self.rank[b_root] += 1;
            }
        }
    }

    fn get_size(&mut self, x: usize) -> usize {
        let root = self.find(x);
        self.size[root]
    }
}

const MOD_P: usize = 1000000007;

#[allow(dead_code)]
// fact(n) = n! mod p
fn fact(n: usize) -> usize {
    let mut acc = 1;
    for i in 1..n + 1 {
        acc = acc * i % MOD_P;
    }
    acc
}

#[allow(dead_code)]
fn mod_pow(b: usize, mut e: usize) -> usize {
    let mut base = b;
    let mut acc = 1;

    while e > 1 {
        if e % 2 == 1 {
            acc = acc * base % MOD_P;
        }
        e /= 2;
        base = base * base % MOD_P;
    }

    if e == 1 {
        acc = acc * base % MOD_P;
    }

    acc
}

#[allow(dead_code)]
fn comb(n: usize, r: usize) -> usize {
    // nCr = n! / (r! (n-r)!) = n! (r!)^(p-2) ((n-r)!)^(p-2)
    let x = ((n - r + 1)..(n + 1)).fold(1, |p, x| p * x % MOD_P);
    let y = mod_pow(fact(r), MOD_P - 2);
    x * y % MOD_P
}

#[derive(Clone, Copy, Debug)]
struct GF(usize);

impl std::ops::Add for GF {
    type Output = GF;
    fn add(self, rhs: GF) -> Self::Output {
        let mut d = self.0 + rhs.0;
        if d >= MOD_P {
            d -= MOD_P;
        }
        GF(d)
    }
}

impl std::ops::AddAssign for GF {
    fn add_assign(&mut self, rhs: GF) {
        *self = *self + rhs;
    }
}

impl std::ops::Sub for GF {
    type Output = GF;
    fn sub(self, rhs: GF) -> Self::Output {
        let mut d = self.0 + MOD_P - rhs.0;
        if d >= MOD_P {
            d -= MOD_P;
        }
        GF(d)
    }
}

impl std::ops::SubAssign for GF {
    fn sub_assign(&mut self, rhs: GF) {
        *self = *self - rhs;
    }
}

impl std::ops::Mul for GF {
    type Output = GF;
    fn mul(self, rhs: GF) -> Self::Output {
        let mut d = self.0 * rhs.0;
        d %= MOD_P;
        GF(d)
    }
}

impl std::ops::MulAssign for GF {
    fn mul_assign(&mut self, rhs: GF) {
        *self = *self * rhs;
    }
}

impl std::fmt::Display for GF {
    fn fmt<'a>(&self, f: &mut std::fmt::Formatter<'a>) -> std::fmt::Result {
        write!(f, "{}", self.0)
    }
}

#[allow(dead_code)]
impl GF {
    pub fn new(n: usize) -> GF {
        GF(n % MOD_P)
    }
    pub fn zero() -> GF {
        GF(0)
    }
    pub fn one() -> GF {
        GF(1)
    }
    pub fn pow(self, mut e: usize) -> GF {
        let mut acc = GF::one();
        let mut b = self;
        while e > 1 {
            if e % 2 == 1 {
                acc *= b;
            }
            b *= b;
            e /= 2;
        }
        if e == 1 {
            acc *= b;
        }
        acc
    }
    pub fn fact(self) -> GF {
        let mut acc = GF::one();
        for i in 1..=self.0 {
            acc *= GF::new(i);
        }
        acc
    }
    pub fn inv(self) -> GF {
        self.pow(MOD_P - 2)
    }
    pub fn comb(n: GF, r: GF) -> GF {
        // nCr = n! / (r! (n-r)!) = n! (r!)^(p-2) ((n-r)!)^(p-2)
        let x = ((n.0 - r.0 + 1)..=n.0).fold(GF::one(), |p, x| p * GF(x));
        let y = r.fact().inv();
        x * y
    }
}

#[allow(dead_code)]
#[derive(Debug)]
struct MemComb {
    inv: Vec<GF>,
    fact: Vec<GF>,
    factinv: Vec<GF>,
}

#[allow(dead_code)]
impl MemComb {
    pub fn new(n: usize) -> MemComb {
        let mut inv = vec![GF::one(); n + 1];
        let mut fact = vec![GF::one(); n + 1];
        let mut factinv = vec![GF::one(); n + 1];

        for i in 2..=n {
            fact[i] = fact[i - 1] * GF(i);
        }

        factinv[n] = fact[n].inv();
        for i in (1..n).rev() {
            factinv[i] = factinv[i + 1] * GF(i + 1); // 1/n! = 1/(n+1)! * (n+1)
            inv[i] = factinv[i] * fact[i - 1]; // 1/n = 1/n! * (n-1)!
        }
        inv[n] = factinv[n] * fact[n - 1];

        MemComb { inv, fact, factinv }
    }
    pub fn comb(&self, n: usize, r: usize) -> GF {
        if n >= r {
            self.fact[n] * self.factinv[r] * self.factinv[n - r]
        } else {
            GF::zero()
        }
    }
}

#[allow(dead_code)]
fn gcd(a: usize, b: usize) -> usize {
    if b > a {
        gcd(b, a)
    } else if a % b == 0 {
        b
    } else {
        gcd(b, a % b)
    }
}

#[allow(dead_code)]
fn getline() -> String {
    let mut __ret = String::new();
    std::io::stdin().read_line(&mut __ret).ok();
    return __ret;
}

#[allow(unused_imports)]
use std::cmp::{max, min};

fn main() {
    input! {
        a: isize,
        b: isize,
        c: isize,
    }
    let ans = if b - a == c - b { "YES" } else { "NO" };
    println!("{}", ans);
}


use std::io::prelude::*;

fn input<T>() -> T
where T: std::str::FromStr {
    let stdin = std::io::stdin();
    let token: String = stdin
        .lock()
        .bytes()
        .map(|c| c.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().unwrap()
}

fn main() {
    let a = input::<i32>();
    let b = input::<i32>();
    let c = input::<i32>();

    if b - a == c - b {
        println!("YES");
    } else {
        println!("NO");
    }
}


// 参考
// https://techracho.bpsinc.jp/jhonda/2019_08_05/78537

// Input macro
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! stdin {
    () => {{
        use std::io::Read;
        let mut s = String::new();
        std::io::stdin().read_to_string(&mut s).unwrap();
        s
    }};
}

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")
    };
}

// Test Code
macro_rules! test {
    ($($input:expr => $output:expr),* $(,)*) => {
        #[test]
        fn solve_test() {
            $(
                assert_eq!(solve($input), $output);
            )*
        }
    };
}

test! {
r"2 4 6
" => r"YES",

r"2 5 6
" => r"NO",

r"3 2 1
" => r"YES"
}

use std::cmp;
use std::cmp::{max, min};
use std::collections::HashSet;
use std::f32::MAX;

fn main() {
    println!("{}", solve(&stdin!()));
}

fn solve(src: &str) -> String {
    input! {
        source = src,
        a: i32,
        b: i32,
        c: i32,
    }

    if b - a == c - b {
        "YES".to_string()
    } else {
        "NO".to_string()
    }
}


#![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());

    let mut o = io.chars();
    let mut e = io.chars();
    for (&a, &b) in o.iter().zip(e.iter()) {
        io.write(a);
        io.write(b);
    }
    if o.len() > e.len() {
        io.write(o.last().unwrap());
    }
}

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 mut o = io.chars();
    let mut e = io.chars();
    for (&a, &b) in o.iter().zip(e.iter()) {
        io.write(a);
        io.write(b);
    }
    if o.len() > e.len() {
        io.write(o.last().unwrap());
    }
}

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
        );
    }
}


import Foundation

let str = readLine()!
let abc = str.componentsSeparatedByString(" ").map{Int($0)!}
let a = abc[0]
let b = abc[1]
let c = abc[2]

if a-b == b-c {
    print("YES")
} else {
    print("NO")
}


import Foundation
let line1 = readLine()!

let abc = line1.componentsSeparatedByString( " " )

let aa:String = abc[0]
let bb:String = abc[1]
let cc:String = abc[2]

let a:Int = Int(aa)!
let b:Int = Int(bb)!
let c:Int = Int(cc)!

if b-a == c-b{

    print("YES")

}
else {
    print("NO")

}


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


import Foundation
let line1 = readLine()!
let line2 = readLine()!
let line3 = readLine()!

let a:Int = Int(line1)!
let b:Int = Int(line2)!
let c:Int = Int(line3)!

if b-a == c-b{

    print("YES")

}

else {print("NO")

}


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]=nrin(3)
  out(b-a==c-b?'YES':'NO')
}
main()


function main(input):void {
	// 1行目がinput[0], 2行目がinput[1], …に入る
	const inpt: Array<string> = input.split('\n');

	const list = inpt[0].split(' ');

	const num1: number = +list[1] - +list[0];
	const num2: number = +list[2] - +list[1];

	console.log((num1 === num2) ? 'YES' : 'NO');
}

// *** debug start ***
function debug(): void{
	const input = (<HTMLInputElement>document.getElementById('input')).value;
	input && main(input);
}
// *** debug end ***

//
declare function require(x: string): any;
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


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

  if (b-a===c-b) {
    console.log('YES');
  }else{
    console.log('NO');
  }
}

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


import * as fs from 'fs';

const [a, b, c]: number[] = fs.readFileSync('/dev/stdin', 'utf8').trim().split(' ').map(Number);
// b-a=c-b
const ans: string = (b - a === c - b) ? 'YES' : 'No';
console.log(ans);


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

  if (b-a===c-b) {
    console.log('YES');
  }else{
    console.log('No');
  }
}

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


a,b,c = map(int,input().split())
print("Yes" if a == b == c else "No")


a,b,c=map(int,input().split())
print("Yes") if a==b==c else print("No")


a, b, c = [int(x) for x in input().split(' ')]

if a==b and b==c:
    print('Yes')
else:
    print('No')


a=input().split()
if set(a)==a:
    print('Yes')
else:
    print('No')


a, b, c = map(int, input().split(' '))
if (a+b>c and b+c>a and c+a>b) and (a == b or b==c or c==a):
  print('Yes')
else:
  print('No')


import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;

public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt();

		if (A == B && B == C) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}

	private static boolean isDebug = System.getProperty("sun.desktop") != null;

	private static void debug(Object... o) {
		if (isDebug) {
			System.err.println(Arrays.deepToString(o));
		}
	}

	public static class Pair {
		private int A;
		private int B;

		public Pair(int a, int b) {
			super();
			A = a;
			B = b;
		}

		public int getA() {
			return A;
		}

		public int getB() {
			return B;
		}
	}

	public static class Scanner {
		private BufferedInputStream inputStream;

		public Scanner(InputStream in) {
			inputStream = new BufferedInputStream(in);
		}

		public int nextInt() throws IOException {
			int num = 0;
			int sign = 1;

			int read = skip();
			if (read == '-') {
				sign = -1;
				read = inputStream.read();
			}

			do {
				num = num * 10 + sign * (read - 0x30);
			} while ((read = inputStream.read()) > 0x20);

			return num;
		}

		public void fill(int[] a) throws IOException {
			for (int i = 0; i < a.length; i++) {
				a[i] = nextInt();
			}
		}

		public void fill(int[] a, int[] b) throws IOException {
			if (a.length != b.length) {
				throw new IllegalArgumentException();
			}

			for (int i = 0; i < a.length; i++) {
				a[i] = nextInt();
				b[i] = nextInt();
			}
		}

		public long nextLong() throws IOException {
			long num = 0;
			int sign = 1;

			int read = skip();
			if (read == '-') {
				sign = -1;
				read = inputStream.read();
			}

			do {
				num = num * 10 + sign * (read - 0x30);
			} while ((read = inputStream.read()) > 0x20);

			return num;
		}

		public void fill(long[] a) throws IOException {
			for (int i = 0; i < a.length; i++) {
				a[i] = nextLong();
			}
		}

		public void fill(long[] a, long[] b) throws IOException {
			if (a.length != b.length) {
				throw new IllegalArgumentException();
			}

			for (int i = 0; i < a.length; i++) {
				a[i] = nextLong();
				b[i] = nextLong();
			}
		}

		public long[] nextLong(int n) throws IOException {
			long[] array = new long[n];
			for (int i = 0; i < n; i++) {
				array[i] = nextLong();
			}

			return array;
		}

		public String next() throws IOException {
			StringBuilder builder = new StringBuilder();

			int read = skip();
			do {
				builder.append((char) read);
			} while ((read = inputStream.read()) > 0x20);

			return builder.toString();
		}

		private int skip() throws IOException {
			int read;
			while ((read = inputStream.read()) <= 0x20)
				;

			return read;
		}
	}
}


import java.io.*;
import java.util.*;
class Main{
	static final long MOD = 1_000_000_007; // 10^9+7
    static final int MAX = 2_147_483_646; // intMax
    static final int INF = 1_000_000_000; // 10^9
    public static void main(String[] args) throws Exception {
		hayami saori = new hayami();
		int a = saori.saori_hayami();
		int b = saori.saori_hayami();
		int c = saori.saori_hayami();
		if(a == b && b == c){
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}

		saori.close();
    }
}

class hayami implements Closeable {
	private final InputStream in = System.in;
	private final byte[] hayami = new byte[1024];
	private int Hayami = 0;
	private int saori = 0;
	private boolean HayamiSaori() {
		if (Hayami < saori) {
			return true;
		}else{
			Hayami = 0;
			try {
				saori = in.read(hayami);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (saori <= 0) {
				return false;
			}
		}
		return true;
	}
	private int SaoriHayami() {
		if (HayamiSaori()) {
            return hayami[Hayami++];
         }else{
             return -1;
         }
	}
	private static boolean hayami_saori(int hayami) {
		return 33 <= hayami && hayami <= 126;
	}
	public boolean hayamisaori() {
		while(HayamiSaori() && !hayami_saori(hayami[Hayami])) Hayami++; return HayamiSaori();
	}
	public String nextHayami() {
		if (!hayamisaori()) throw new NoSuchElementException();
		StringBuilder hayamin = new StringBuilder();
		int saori = SaoriHayami();
		while(hayami_saori(saori)) {
			hayamin.appendCodePoint(saori);
			saori = SaoriHayami();
		}
		return hayamin.toString();
	}
	public long saorihayami() {//nextLong
		if (!hayamisaori()) throw new NoSuchElementException();
		long hayami = 0;
		boolean misao = false;
		int saori = SaoriHayami();
		if (saori == '-') {
			misao = true;
			saori = SaoriHayami();
		}
		if (saori < '0' || '9' < saori) {
			throw new NumberFormatException();
		}
		while(true){
			if ('0' <= saori && saori <= '9') {
				hayami *= 10;
				hayami += saori - '0';
			}else if(saori == -1 || !hayami_saori(saori)){
				return misao ? -hayami : hayami;
			}else{
				throw new NumberFormatException();
			}
			saori = SaoriHayami();
		}
	}
	public int saori_hayami() {//nextInt
		long hayami = saorihayami();
		if (hayami < Integer.MIN_VALUE || hayami > Integer.MAX_VALUE) throw new NumberFormatException();
		return (int) hayami;
	}
	public double Hayamin() { //nextDouble
		return Double.parseDouble(nextHayami());
	}
	public void close() {
		try {
			in.close();
		} catch (IOException e) {
		}
    }

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.Set;

public class Main {
    public static void main(String[] args) {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        Set<String> set = new HashSet<>();
        String[] reading = null;
        try {
        reading = reader.readLine().split(" ");

        set.add(reading[0]);
        set.add(reading[1]);
        set.add(reading[2]);

        if (set.size() > 1) {
            System.out.println("No");
        } else {
            System.out.println("Yes");
        }

        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}


import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int c = sc.nextInt();
    if(a==b&&b==c)System.out.println("Yes");
    else SYstem.out.println("No");
  }
}


import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner scn = new Scanner(System.in);

		int a = scn.nextInt();
		int b = scn.nextInt();
		String c = scn.next();
		String[] strArray = c.split("");

		List<String> moji = new ArrayList<>();
		List<Integer> golem = new ArrayList<>();

		for (int i = 0; i < strArray.length; i++) {
			moji.add(strArray[i]);
		}
		for(int i = 0; i < moji.size(); i++) {
			golem.add(1);
		}

		for(int i = 0; i < b; i++) {
			String d = scn.next();
			String e = scn.next();

			for(int j = 0; j < moji.size(); j++) {
				if(moji.get(j).equals(d)) {
					if(e.equals("L")) {
						if(golem.get(j) > 0 && j != 0) {
							golem.set(j - 1, golem.get(j) + golem.get(j - 1));
						}
					} else {
						if(golem.get(j) > 0 && j != moji.size() - 1) {
							golem.set(j + 1, golem.get(j) + golem.get(j + 1));
						}
					}
					golem.set(j, 0);
				}
			}
		}

		System.out.println(golem.stream().mapToInt(n -> n).sum());
	}

}


import java.util.Arrays;
import java.util.Map;
import java.util.Scanner;
import java.util.TreeMap;

public class Main {

    public static void main(String args[]){
        Scanner in=new Scanner(System.in);
        //
        int a[]=new int[3];
        for(int i=0;i<3;i++){
            a[i]=in.nextInt();
        }
        Arrays.sort(a);
        //
        boolean ans=a[0]+a[1]>a[2]?true:false;
        System.out.println(ans==true?"Yes":"No");
    }

}


#include <cstdio>

int main() {
  int a, b, c;
  scanf("%d%d%d", &a, &b, &c);
  if (a == b && b == c)
    printf("Yes");
  else
    printf("No");
}


#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;
int gi(){
	int x=0,w=1;char ch=getchar();
	while((ch<'0'||ch>'9')&&ch!='-')ch=getchar();
	if(ch=='-')w=0,ch=getchar();
	while(ch>='0'&&ch<='9')x=(x<<3)+(x<<1)+ch-'0',ch=getchar();
	return w?x:-x;
}
int main(){
	int a=gi(),b=gi(),c=gi();
	puts(a==b&&b==c?"Yes":"No");
	return 0;
}


#include <iostream>
using namespace std;
int main() {
  int a, b, c;
  cin >> a >> b >> c;
  if(a == b && b == c && c == a) cout << "Yes" << endl;
  else cout << "No" << endl;
}


    #include<iostream>
    #include<stdio.h>
    //#include <bits/stdc++.h>
    #include<vector>
    #include<float.h>
    #include<iomanip>
    #include<algorithm>
    #include<string>
    #include<cstring>
    #include<math.h>
    #include<cmath>
    #include<sstream>
    #include<set>
    #include<map>
    #include<queue>
    #include<cassert>
    #include<cmath>
    #include<cstdint>
    #include<numeric>
    #include<array>

    #define INF 1e9
    #define rep(i,n)for(int i=0;(i)<(int)(n);i++)
    #define REP(i,a,b)for(int i=(int)(a);(i)<=(int)(b);i++)
    #define VEC(type, c, n) std::vector<type> c(n);for(auto& i:c)std::cin>>i;
    #define vec(type,n) vector<type>(n)
    #define vvec(m,n) vector<vector<int>> (int(m),vector<int>(n))
    #define ALL(a)  (a).begin(),(a).end()
    #define chmin(a, b) a = min(a, b)
    #define chmax(a, b) a = max(a, b)
    #define Vl vector<ll>

    using namespace std;
    using ll = long long;
    using Graph = vector<vector<ll>>;
    using P = pair<ll, ll>;

const ll MOD = 1e9 + 7;
const ll ZER = 0;

int main(){
    vector<int> a(3);
    rep(i, 3)cin >> a[i];
    sort(ALL(a));
    if(a[0] == a[1])cout << "Yes" << endl;
    else cout << "No" << endl;
}


#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
using ll = long long;

int main() {
  int A, B, C;
  cin >> A >> B >> C;

  if (max({A, B, C}) * 2 < A + B + C)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}


#pragma region
#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <map>
#include <queue>
#include <stack>
#include <set>
#include <list>
#include <iomanip>
#include <cstdint>
#include <bitset>
#include <fstream>

using namespace std;
typedef long long ll;
//#define rep(i, s, e) for (int(i) = (s); (i) < (e); ++(i))
#define rep(i, e) for (int(i) = 0; (i) < (e); ++(i))
#define rrep(i, s) for (int(i) = (s) - 1; (i) >= 0; --(i))
#define all(x) x.begin(),x.end()

#pragma region UnionFind
struct UnionFind
{
	vector<int> par;

	UnionFind(int n) : par(n, -1) {}
	void init(int n) { par.assign(n, -1); }

	int root(int x)
	{
		if (par[x] < 0) return x;
		else return par[x] = root(par[x]);
	}

	bool issame(int x, int y)
	{
		return root(x) == root(y);
	}

	bool merge(int x, int y)
	{
		x = root(x); y = root(y);
		if (x == y) return false;
		if (par[x] > par[y]) swap(x, y);
		par[x] += par[y];
		par[y] = x;
		return true;
	}

	int size(int x)
	{
		return -par[root(x)];
	}
};
#pragma endregion
#pragma region GCD
int gcd(int a, int b)
{
	if (a%b == 0)return b;
	return gcd(b, a%b);
}
#pragma endregion
#pragma region chmin
template<class T> inline bool chmin(T& a, T b)
{
	if (a > b)
	{
		a = b;
		return true;
	}
	return false;
}
#pragma endregion
#pragma region chmax
template<class T> inline bool chmax(T& a, T b)
{
	if (a < b)
	{
		a = b;
		return true;
	}
	return false;
}
#pragma endregion
#pragma endregion

int main()
{
	int a, b, c; cin >> a >> b >> c;
	if (a + b > c && a + c > b && b + c > a)cout << "Yes" << endl;
	else cout << "No" << endl;
}


#include <stdio.h>

int main(void){

        int a,b,c;

        scanf("%d%d%d",&a,&b,&c);

        if(a==b && b==c){
                printf("Yes\n");
        }else{
                printf("No\n");
        }
return 0;
}


main(a,b,c){scanf("%d%d%d",&a,&b,&c)<puts(a-b|b-c?"No":"Yes");}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <math.h>

int main(){
    int a,b,c;
    scanf("%d%d%d",&a,&b,&c);
    if (a==b&&b==c) {
        printf("Yes\n");
    }else{
        printf("No\n");
    }
    return 0;
}


#include <stdio.h>
int main() {
	int a,b,c;
	scanf("%d%d%d", &a,&b,&c);
	if (a==b==c) {
		printf("Yes\n");
	} else {
		printf("No\n");
	}
	return 0;
}


#include <stdio.h>
int main (void){
  int A,B,C;
  scanf("%d %d %d",&A,&B,&C);
  if(A==B==C){
    printf("Yes");
  }
  else {
    printf("No");
  }
  return 0;
}


#include <stdio.h>
int main (void){
  int A,B,C;
  scanf("%d %d %d ",&A,&B,&C);
  if(A==B==C){
    printf("Yes");
  }
  else {
    printf("No");
  }
  return 0;
}


'use strict'

const main = input => {
	const args = input.split('\n').map(arg => arg.split(' '))
	const A = parseInt(args[0][0], 10)
	const B = parseInt(args[0][1], 10)
	const C = parseInt(args[0][2], 10)
	console.log((A === B && B === C) ? 'Yes' : 'No')
}

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


function MainA(input) {
	input = input.split("\n")[0].split(" ");
	var a = input[0];
	var b = input[1];
	var c = input[2];
	var result = (a == b && b == c) ? "Yes" : "No";

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


function Main(input) {
	var values = input.split(" ");
	console.log((values[0] == values[1] && values[0] == values[2]) ? "Yes" : "No");
}

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


// inputに入力データ全体が入る
function Main(input) {
  input = input.split(' ').map(val => parseInt(val));

  var ans = 'YES'
  for (var i of input) {
    if(input[0] !== i) {
      ans = 'NO';
      break;
    }
  }

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


// inputに入力データ全体が入る
function Main(input) {
  input = input.split(' ').map(val => parseInt(val));

  let ans = 'YES'
  for (let i of input) {
    if(input[0] !== i) {
      ans = 'NO';
      break;
    }
  }

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


var lines = [];
var readline = require('readline');

var rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});

rl.on('line', function(input) {
    lines.push(input);
});

rl.on('close', function() {
    var inputsAsArr = lines[0].split(' ');
    var sideA = inputsAsArr[0];
    var sideB = inputsAsArr[1];
    var sideC = inputsAsArr[2];

    var outputStr = sideA === sideB === sideC ? 'Yes' : 'No';
    console.log(outputStr);
});


// ProblemURL : https://atcoder.jp/contests/exawizards2019/tasks/exawizards2019_a
// ---------------------------------------------
package main

import "fmt"

func main() {
	var a, b, c int
	fmt.Scan(&a, &b, &c)
	ok := a == b && b == c
	if ok {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}


package main

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

var sc = bufio.NewScanner(os.Stdin)

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

func nextInt() int {
	sc.Scan()
	i, _ := strconv.Atoi(sc.Text())
	return i
}

func nextFloat64() float64 {
	f, _ := strconv.ParseFloat(next(), 64)
	return f
}

func nextInts(n int) []int {
	slice := make([]int, n)
	for i := 0; i < n; i++ {
		slice[i] = nextInt()
	}
	return slice
}

func main() {
	sc.Split(bufio.ScanWords)
	a, b, c := nextInt(), nextInt(), nextInt()
	if a == b && b == c {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}


package main

import(
	"fmt"
)

func main() {
	var a,b,c int
  fmt.Scan(&a,&b,&c)

  if a == b && b == c {
    fmt.Println("Yes")
  } else {
    fmt.Println("No")
  }

}


package main

import (
	"fmt"
	"sort"
)

func main() {
	xs := make([]int, 3)
	for i := range xs {
		fmt.Scan(&xs[i])
	}
	sort.Ints(xs)
	if v := xs[0] + xs[1]; v <= xs[2] || v > xs[2] {
		fmt.Println("No")
	} else {
		fmt.Println("Yes")
	}
}


package main

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

var sc = bufio.NewScanner(os.Stdin)

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

func nextInt() int {
	sc.Scan()
	i, _ := strconv.Atoi(sc.Text())
	return i
}

func nextFloat64() float64 {
	f, _ := strconv.ParseFloat(next(), 64)
	return f
}

func nextInts(n int) []int {
	slice := make([]int, n)
	for i := 0; i < n; i++ {
		slice[i] = nextInt()
	}
	return slice
}

func main() {
	sc.Split(bufio.ScanWords)
	a, b, c := nextInt(), nextInt(), nextInt()
	if a+b > c && b+c > a && c+a > b {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}


// ProblemURL : https://atcoder.jp/contests/exawizards2019/tasks/exawizards2019_a
// ---------------------------------------------
package main

import "fmt"

func main() {
	var a, b, c int
	fmt.Scan(&a, &b, &c)
	ok := a+b > c && b+c > a && c+a > b
	if ok {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}


puts gets.split.map(&:to_i).uniq.size == 1 ? "Yes" : "No"


a,b,c = gets.split.map(&:to_i)

puts a==b && b==c ? 'Yes' : 'No'


a, b, c = gets.split.map(&:to_i)
puts (a == b && b == c) ? "Yes" : "No"


nums = 3.times.map{gets.to_i}
if nums.all? { |n| n == nums[0] }
  puts 'Yes'
else
  puts 'No'
end


nums = 3.times.map{gets.to_i}
if nums.all? { |n| n == nums[0] }
  puts 'True'
else
  puts 'False'
end


a,b,c=gets.split.map(&:to_i)
putd a==b && b==c ? "Yes" : "No"


#[allow(unused_imports)]
use std::char::*;
#[allow(unused_imports)]
use std::cmp::*;
use std::io::*;
use std::str::FromStr;
#[allow(unused_imports)]
use std::collections::*;

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        eprintln!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

#[derive(PartialEq, PartialOrd)]
pub struct Total<T>(pub T);

impl<T: PartialEq> Eq for Total<T> {}

impl<T: PartialOrd> Ord for Total<T> {
    fn cmp(&self, other: &Total<T>) -> std::cmp::Ordering {
        self.0.partial_cmp(&other.0).unwrap()
    }
}

//const MAX:usize = 100006;
//const INF:u64 = u64::max_value();

fn main() {
    let a:Vec<u32> = (0..3).map(|_| read()).collect();

    println!("{}",
        if a[0] == a[1] && a[1] == a[2] {"Yes"}
        else {"No"}
    );

}


#[macro_use]
mod input {

use std;
use std::io;

const SPLIT_DELIMITER: char = ' ';

#[macro_export]
#[allow(unused_macros)]
macro_rules! input {
    ( $($x:expr ),*) => {
        {
            let temp_str = input_line_str();
            let mut split_result_iter = temp_str.split_whitespace();
                $(
                let buf_split_result = split_result_iter.next();
                let buf_split_result = buf_split_result.unwrap();
                    ($x) = buf_split_result.parse().unwrap();
                )*
        }
    };
}

#[allow(dead_code)]
pub fn input_line_str() -> String {
    let mut s = String::new();
    io::stdin().read_line(&mut s).unwrap();
    s.trim().to_string()
}

#[allow(dead_code)]
pub fn p<T>(t: T)
where
    T: std::fmt::Display,
{
    println!("{}", t);
}

#[allow(dead_code)]
pub fn input_vector2d<T>(line: usize) -> Vec<Vec<T>>
where
    T: std::str::FromStr,
{
    let mut v: Vec<Vec<T>> = Vec::new();

    for _ in 0..line {
        let vec_line = input_vector();
        v.push(vec_line);
    }
    v
}

#[allow(dead_code)]
pub fn input_vector<T>() -> Vec<T>
where
    T: std::str::FromStr,
{
    let mut v: Vec<T> = Vec::new();

    let s = input_line_str();
    let split_result = s.split(SPLIT_DELIMITER);
    for z in split_result {
        let buf = match z.parse() {
            Ok(r) => r,
            Err(_) => panic!("Parse Error"),
        };
        v.push(buf);
    }
    v
}

#[allow(dead_code)]
pub fn str2vec(s: &str) -> Vec<char> {
    let mut v: Vec<char> = Vec::new();
    for c in s.chars() {
        v.push(c);
    }
    v
}
}

use input::*;

fn main() {
    let (a, b, c): (usize, usize, usize);
    input!(a, b, c);
    if a == b && b == c {
        p("Yes");
    } else {
        p("No");
    }
}


use std::io::{stdin, Read, StdinLock};
use std::str::FromStr;

fn main() {
    let cin = stdin();
    let cin = cin.lock();
    let mut scan = Scanner::new(cin);

    let mut e = scan.readn::<i32>(3);
    e.sort();
    println!("{}", if e[0]==e[1] && e[1]==e[2] {"Yes"} else {"No"});
}

// region template
#[allow(dead_code)]
fn uz(i: i32) -> usize { i as usize }

#[allow(dead_code)]
fn chmax<T: PartialOrd>(a: &mut T, b: T) -> bool {
    if *a < b {
        *a = b;
        true
    } else { false }
}

#[allow(dead_code)]
fn chmin<T: PartialOrd>(a: &mut T, b: T) -> bool {
    if *a > b {
        *a = b;
        true
    } else { false }
}

struct Scanner<'a> {
    cin: StdinLock<'a>,
}

#[allow(dead_code)]
impl<'a> Scanner<'a> {
    fn new(cin: StdinLock<'a>) -> Scanner<'a> {
        Scanner { cin: cin }
    }

    fn read1<T: FromStr>(&mut self) -> Option<T> {
        let token = self.cin.by_ref().bytes().map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect::<String>();
        token.parse::<T>().ok()
    }

    fn read<T: FromStr>(&mut self) -> T {
        self.read1().unwrap()
    }

    fn readn<T: FromStr>(&mut self, n: i32) -> Vec<T> {
        let mut ret = vec![];
        for _ in 0..n { ret.push(self.read::<T>()) }
        ret
    }

    fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
}
// endregion


pub mod mylib {
use std;
use std::ops::{Add, AddAssign, Div, DivAssign, Mul, MulAssign, Sub, SubAssign};
use std::cmp::PartialEq;
use std::str::FromStr;
use std::num::ParseIntError;
use std::fmt::{Display, Formatter};

#[macro_use]
mod macros {
macro_rules! impl_to_modint {
	($($t:ty)*) => ($(
		impl <MOD: ModNumber> ToModInt<MOD> for $t {
			#[inline]
			fn to_modint(self) -> ModInt<MOD> {
				if <$t>::min_value() == 0 {
					<MOD>::from_bu(self as u64)
				} else {
					<MOD>::from_bi(self as i64)
				}
			}
		}
	)*)
}
macro_rules! impl_modint {
	($($im:ty,$b:block);*) => ($(
		impl ModNumber for $im {
			type ModType = u32;
			fn modv() -> Self::ModType $b
			#[inline]
			from_bi_prim_to_modint!($im);
			#[inline]
			from_bu_prim_to_modint!($im);
			#[inline]
			fn direct(x: u32) -> ModInt<$im> {
				ModInt::<$im>(x)
			}
		}
	)*)
}

macro_rules! from_bu_prim_to_modint {
	($($im:ty),*) => ($(
		fn from_bu(x: u64) -> ModInt<$im> {
			let m = <$im>::modv() as u64;
			ModInt::<$im>((x % m) as u32)
		}
	)*)
}
macro_rules! from_bi_prim_to_modint {
	($($im:ty),*) => ($(
		fn from_bi(i: i64) -> ModInt<$im> {
			let m = <$im>::modv() as i64;
			let mut i = i % m;
			if i < 0 {i += m;}
			ModInt::<$im>((i % m) as u32)
		}
	)*)
}

macro_rules! impl_modint_operators {
	($($m:ty)*) => ($(
		impl Add<ModInt<$m>> for ModInt<$m> {
			type Output = ModInt<$m>;
			fn add(self, rhs: ModInt<$m>) -> ModInt<$m> {
				ModInt::<$m>((self.0 + rhs.0) % <$m>::modv())
			}
		}
		impl AddAssign<ModInt<$m>> for ModInt<$m> {
			fn add_assign(&mut self, rhs: ModInt<$m>) {
				*self = *self + rhs;
			}
		}
		impl Sub<ModInt<$m>> for ModInt<$m> {
			type Output = ModInt<$m>;
			fn sub(self, rhs: ModInt<$m>) -> ModInt<$m> {
				let mut x = self.0 as i32 - rhs.0 as i32;
				if x < 0 {x += <$m>::modv() as i32}
				ModInt::<$m>(x as u32 % <$m>::modv())
			}
		}
		impl SubAssign<ModInt<$m>> for ModInt<$m> {
			fn sub_assign(&mut self, rhs: ModInt<$m>) {
				*self = *self - rhs;
			}
		}
		impl Mul<ModInt<$m>> for ModInt<$m> {
			type Output = ModInt<$m>;
			fn mul(self, rhs: ModInt<$m>) -> ModInt<$m> {
				let x = self.0 as u64 * rhs.0 as u64;
				ModInt::<$m>((x % <$m>::modv() as u64) as u32)
			}
		}
		impl MulAssign<ModInt<$m>> for ModInt<$m> {
			fn mul_assign(&mut self, rhs: ModInt<$m>) {
				*self = *self * rhs;
			}
		}
		impl Div<ModInt<$m>> for ModInt<$m> {
			type Output = ModInt<$m>;
			fn div(self, rhs: ModInt<$m>) -> ModInt<$m> {
				self * rhs.pow((<$m>::modv() - 2) as u64)
			}
		}
		impl DivAssign<ModInt<$m>> for ModInt<$m> {
			fn div_assign(&mut self, rhs: ModInt<$m>) {
				*self = *self / rhs;
			}
		}
		impl PartialEq<ModInt<$m>> for ModInt<$m> {
			fn eq(&self, rhs: &ModInt<$m>) -> bool {
				self.0 == rhs.0
			}
		}
	)*)
}
macro_rules! impl_modint_fromstr {
	($($m:ty),*) => ($(
		impl FromStr for ModInt<$m> {
			type Err = ParseIntError;
			fn from_str(s: &str) -> Result<Self, Self::Err> {
				if s.bytes().next() == Some(b'-') {
					Ok(<$m>::from_bi(s.parse::<i64>()?))
				} else {
					Ok(<$m>::from_bu(s.parse::<u64>()?))
				}
			}
		}
	)*)
}
macro_rules! impl_modint_display {
	($($m:ty),*) => ($(
		impl Display for ModInt<$m> {
			fn fmt(&self, f: &mut Formatter) -> std::fmt::Result {
				write!(f, "{}", self.0)
			}
		}
	)*)
}
} // mod macros

pub trait ToModInt<MOD: ModNumber> {
	fn to_modint(self) -> ModInt<MOD>;
}
impl_to_modint!(i8 i16 i32 i64 u8 u16 u32 u64 usize isize);

pub trait ModNumber : Clone + Copy {
	type ModType: Clone + Copy;
	fn modv() -> Self::ModType;
	fn from_bi(x: i64) -> ModInt<Self>;
	fn from_bu(x: u64) -> ModInt<Self>;
	fn direct(x: u32) -> ModInt<Self>;
}

impl_modint!(RuntimeMod, {unsafe{RUNTIME_MOD}};
             Mod107, {1_000_000_007};
             Mod998, {998_244_353});

static mut RUNTIME_MOD: u32 = 0;
#[derive(Clone, Copy)]
pub struct RuntimeMod {}
impl RuntimeMod {
	pub fn set(x: u32) {
		unsafe {
			RUNTIME_MOD = x;
		}
	}
}
#[derive(Clone, Copy)]
pub struct Mod107 {}
#[derive(Clone, Copy)]
pub struct Mod998 {}
#[derive(Clone, Copy)]
pub struct ModInt<MOD: ModNumber> (pub MOD::ModType);

impl_modint_operators!(Mod107 Mod998 RuntimeMod);

impl<MOD: ModNumber> ModInt<MOD>
where
	ModInt<MOD>: MulAssign
{
	pub fn pow(self, mut p: u64) -> Self {
		let mut res = <MOD>::direct(1);
		let mut m = self;
		while p != 0 {
			if p & 1 == 1 {
				res *= m;
			}
			p >>= 1;
			m *= m;
		}
		res
	}
}

impl_modint_fromstr!(RuntimeMod, Mod107, Mod998);

impl_modint_display!(RuntimeMod, Mod107, Mod998);
}

pub struct IO<R, W: std::io::Write>(R, std::io::BufWriter<W>);

impl<R: std::io::Read, W: std::io::Write> IO<R, W> {
    pub fn new(r: R, w: W) -> IO<R, W> {
        IO(r, std::io::BufWriter::new(w))
    }
    pub fn write<S: ToString>(&mut self, s: S) {
        use std::io::Write;
        self.1.write(s.to_string().as_bytes()).unwrap();
    }
    pub fn read<T: std::str::FromStr>(&mut self) -> T {
        use std::io::Read;
        let buf = self
            .0
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b' ' || b == b'\n' || b == b'\r' || b == b'\t')
            .take_while(|&b| b != b' ' && b != b'\n' && b != b'\r' && b != b'\t')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read()).collect()
    }
    pub fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn test_io() {
        let input = br"10
        1 2 3 4 5 6 7 8 9 10
        abcde fghij

        3.14 -1592
        no_empty_line";
        let mut sc = IO::new(&input[..], Vec::new());

        let n: usize = sc.read();
        assert_eq!(n, 10);

        let a: Vec<u64> = sc.vec(n);
        assert_eq!(&a, &[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);

        let s = sc.chars();
        let t = sc.chars();
        assert_eq!(&s, &['a', 'b', 'c', 'd', 'e']);
        assert_eq!(&t, &['f', 'g', 'h', 'i', 'j']);

        let f: f64 = sc.read();
        assert_eq!(f, 3.14);

        let neg: i64 = sc.read();
        assert_eq!(neg, -1592);

        let s = sc.read::<String>();
        assert_eq!(&s, "no_empty_line");
        sc.write(format!("1\n"));

        let mut output = Vec::new();
        {
            let mut sc = IO::new(&b""[..], &mut output);
            sc.write(format!("{}\n", 1));
            sc.write(format!("{}\n", 2));
            sc.write(format!("{}\n", 3));
        }

        let output = String::from_utf8(output).expect("Not UTF-8");
        assert_eq!(&output, "1\n2\n3\n");
    }
}

// type ModType = mylib::RuntimeMod;
 type ModType = mylib::Mod107;
// type ModType = mylib::Mod998;
type ModInt = mylib::ModInt<ModType>;

#[inline]
fn modint<T: mylib::ToModInt<ModType>>(x: T) -> ModInt {
	x.to_modint()
}

fn main() {
	let (r, w) = (std::io::stdin(), std::io::stdout());
	let mut sc = IO::new(r.lock(), w.lock());
	let b: usize = sc.read();
	let w: usize = sc.read();

	let n = b + w;
	let mut fact = vec![modint(1); n];
	for i in 1..n {
		fact[i] = fact[i-1] * modint(i);
	}
	let comb = |n: usize, r: usize| fact[n] / fact[r] / fact[n-r];
	let mut p = modint(0);
	let mut q = modint(0);

	for i in 1..n+1 {
		println!("{}", ((modint(1) - p + q) / modint(2)).0);
		if i >= b {
			p += comb(i-1, b-1) / modint(2).pow(i as u64);
		}
		if i >= w {
			q += comb(i-1, w-1) / modint(2).pow(i as u64);
		}
	}

}


use std::io;

fn main() {
    let mut buf = String::new();
    io::stdin().read_line(&mut buf).unwrap();
    let q_len = {
        let mut n_and_q = buf.split_whitespace();
        n_and_q.next().unwrap();
        n_and_q.next().unwrap().parse::<usize>().unwrap()
    };

    buf.clear();
    io::stdin().read_line(&mut buf).unwrap();
    buf.pop().unwrap();
    let s = buf;

    let mut spells = vec![String::new(); q_len];
    for spell in spells.iter_mut() {
        io::stdin().read_line(spell).unwrap();
    }

    let spells: Vec<_> = spells
        .into_iter()
        .map(|spell| {
            let mut iter = spell.split_whitespace();
            let t = iter.next().unwrap().chars().next().unwrap();
            let d = iter.next().unwrap().chars().next().unwrap();
            (t, d)
        })
        .collect();

    let mut indices = Vec::with_capacity(s.len());
    let mut golems = vec![1_u32; s.len()];
    for (t, d) in spells.into_iter() {
        for (i, s) in s.chars().enumerate() {
            if s == t { indices.push(i); }
        }

        for &index in indices.iter() {
            match d {
                'R' => {
                    if index != s.len() - 1 {
                        golems[index+1] += golems[index];
                    }
                    golems[index] = 0;
                }
                'L' => {
                    if index != 0 {
                        golems[index-1] += golems[index];
                    }
                    golems[index] = 0;
                }
                e @ _ => panic!("unexpected char '{}'", e),
            }
        }

        indices.clear();
    }

    println!("{}", golems.iter().sum::<u32>());
}


use std::io;

fn main() {
    let mut buf = String::new();
    io::stdin().read_line(&mut buf).unwrap();
    let q_len = {
        let mut n_and_q = buf.split_whitespace();
        n_and_q.next().unwrap();
        n_and_q.next().unwrap().parse::<usize>().unwrap()
    };

    buf.clear();
    io::stdin().read_line(&mut buf).unwrap();
    buf.pop().unwrap();
    let s = buf;

    let mut spells = vec![String::new(); q_len];
    for spell in spells.iter_mut() {
        io::stdin().read_line(spell).unwrap();
    }

    let spells: Vec<_> = spells
        .into_iter()
        .map(|spell| {
            let mut iter = spell.split_whitespace();
            let t = iter.next().unwrap().chars().next().unwrap();
            let d = iter.next().unwrap().chars().next().unwrap();
            (t, d)
        })
        .collect();

    let mut indices = Vec::with_capacity(s.len());
    let mut golems = vec![1_u32; s.len()];
    for (t, d) in spells.into_iter() {
        s.chars()
            .enumerate()
            .map(|(i, s)| if s == t { indices.push(i); });

        indices
            .iter()
            .map(|&index| {
                match d {
                    'R' => {
                        if index != s.len() - 1 {
                            golems[index+1] += golems[index];
                        }
                        golems[index] = 0;
                    }
                    'L' => {
                        if index != 0 {
                            golems[index-1] += golems[index];
                        }
                        golems[index] = 0;
                    }
                    e @ _ => panic!("unexpected char '{}'", e),
                }
            });

        indices.clear();

    }

    println!("{}", golems.iter().sum::<u32>());
}


import Foundation

#if swift(>=4.0)
extension String {
    func split(by separator: String) -> [String] {
        return self.components(separatedBy: separator)
    }
}
#else
extension String {
    func split(by separator: String) -> [String] {
        return self.componentsSeparatedByString(separator)
    }
    func count() -> Int {
        return self.characters.count
    }
}
extension Array where Element: Comparable {
    func max() -> Element! {
        return self.maxElement()
    }
    func min() -> Element! {
        return self.minElement()
    }
    func sorted() -> Array {
        return self.sort()
    }
    func reversed() -> Array {
        return self.reverse()
    }
    mutating func sort() {
        self.sortInPlace()
    }
}
extension Array {
    init(repeating: Element, count: Int) {
        self.init(count: count, repeatedValue: repeating)
    }
}
func stride<T: Strideable>(from start: T, to end: T, by stride: T.Stride) -> StrideTo<T> {
    return start.stride(to: end, by: stride)
}
#endif
func readInt() -> Int? {
    return Int(readLine()!)
}
func readStringSplit(by separator: String) -> [String] {
    return readLine()!.split(by: separator)
}
func readIntSplit(by separator: String) -> [Int] {
    return readLine()!.split(by: separator).map{Int($0)!}
}

/*************** テストスペース ***************/

/*************** メインプログラム ***************/

let input = readIntSplit(by: " ")
let (A, B, C) = (input[0], input[1], input[2])

print((A == B && B == C) ? "Yes" : "No")


import Foundation

let input = readLine()!.componentsSeparatedByString(" ").map { Int($0)! }
if input[0] == input[1] && input[1] == input[2] {
	print("Yes")
} else {
	print("No")
}


init main(a: Int, b: Int, c: Int) {

  let a:Int = a
  let b:Int = b
  let c:Int = c
  var isEqTriangle: Bool = false

  if a =b && b=c {
    isEqTriangle = true
  } else {
    isEqTriangle = false
  }

  print(isEqTriangle)

}


import Foundation

let input = readLine()!.components(separatedBy: " ").map { Int($0)! }
if input[0] == input[1] || input[1] == input[2] {
	print("Yes")
} else {
  	print("No")
}


import Foundation

let input = readLine()!.components(separatedBy: " ").map { Int($0)! }
if input[0] == input[1] || input[1] == input[2] {
	print("Yes")
else {
  	print("No")
}


[A,B,C]=require('fs').readFileSync('/dev/stdin','utf8').split(' ').map(n=>n|0)
console.log(A==B&&B==C?'Yes':'No')


function main(input) {
  const a = input.split(" ").map(v => parseInt(v))
  console.log(a[0] === a[1] && a[1] === a[2] ? "Yes" : "No");
}
main(require("fs").readFileSync("/dev/stdin", "utf8").trim());


export class Main {
  static main(input): string {
    const [a, b, c]: number[] = input.split("\n")[0].split(" ").map(Number);
    return `${a == b && b == c ? "Yes" : "No"}`;
  }
}
console.log(Main.main(require("fs").readFileSync("/dev/stdin", "utf8")));


// inputに入力データ全体が入る
function Main(input) {
	const temp = input.split(" ")
	console.log(temp[0] == temp[1] && temp[1] == temp[2] ? "Yes" : "No")
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


[A,B,C]=require('fs').readFileSync('/dev/stdin','utf8').split(' ')
console.log(A==B&&B==C?'Yes':'No')


def solve(string):
    n, m, *ps = string.split()
    n = int(n)
    ac = [0] * n
    wa = [0] * n
    for p, s in zip(*[iter(ps)] * 2):
        p = int(p) - 1
        if s == "AC":
            ac[p] = 1
        elif not ac[p]:
            wa[p] += 1
    return "{} {}".format(sum(ac), sum([w * a for a, w in zip(ac, wa)]))

if __name__ == '__main__':
    import sys
    print(solve(sys.stdin.read().strip()))


def solve(string):
    n, m, *ps = string.split()
    n = int(n)
    ac = [0] * n
    wa = [0] * n
    for p, s in zip(*[iter(ps)] * 2):
        p = int(p) - 1
        if s == "AC":
            ac[p] = 1
        elif not ac[p]:
            wa[p] += 1
    return "{} {}".format(sum(ac), sum([w if a else 0 for a, w in zip(ac, wa)]))

if __name__ == '__main__':
    import sys
    print(solve(sys.stdin.read().strip()))


N, M = map(int, input().split())

AC = 0
WA = 0
AC_count = set()
num = set()

for _ in range(M):
    p, S = input().split()
    if not int(p) in num:
        num.add(int(p))
        if S == 'WA':
            WA += 1
        else:
            AC += 1
            AC_count.add(int(p))
    else:
        if S == 'AC' and not int(p) in AC_count:
            AC += 1
            AC_count.add(int(p))
        elif S == 'WA' and not  int(p) in AC_count:
            WA += 1

print(AC, WA)


N, M = map(int, input().split())

AC = 0
WA = 0
AC_count = set()
num = set()

for _ in range(M):
    p, S = input().split()
    if not int(p) in num:
        num.add(int(p))
        if S == 'WA':
            WA += 1
        else:
            AC += 1
            AC_count.add(int(p))
    else:
        if S == 'AC' and not int(p) in AC_count:
            AC += 1
            AC_count.add(int(p))
        elif S == 'WA' and not  int(p) in AC_count:
            WA += 1
            AC_count.add(int(p))
print(AC, WA)


N, M = map(int, input().split())

AC = 0
WA = 0
AC_count = 0
num = set()

for _ in range(M):
    p, S = input().split()
    if not int(p) in num:
        num.add(int(p))
        AC_count = 0
        if S == 'WA':
            WA += 1
        else:
            AC += 1
            AC_count = 1
    else:
        if S == 'AC' and AC_count == 0:
            AC += 1
            AC_count = 1
        elif S == 'WA' and AC_count == 0:
            WA += 1
print(AC, WA)


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

public class Main {
	static void solve() {
		int n = ni(), m = ni();
		boolean ac[] = new boolean[n];
		int wa[] = new int[n];
		int cnt[] = new int[2];
		for(int i=0;i<m;i++) {
			int p = ni()-1;
			String s = ns();
			if(ac[p])continue;
			if(s.equals("WA"))wa[p]++;
			else {
				ac[p] = true;
				cnt[0] ++;
				cnt[1] += wa[p];
			}
		}
		out.println(cnt[0] + " " + cnt[1]);
	}

	//constant
	static final long mod = (long) 1e9 + 7;
	static final int dx[] = { -1, 0, 1, 0 }, dy[] = { 0, -1, 0, 1 };
	static final int[] dx8 = { -1, -1, -1, 0, 0, 1, 1, 1 }, dy8 = { -1, 0, 1, -1, 1, -1, 0, 1 };
	static final int inf = Integer.MAX_VALUE / 3;
	static final long linf = Long.MAX_VALUE / 3;
	static final double dinf = Double.MAX_VALUE / 3;
	static final double eps = 1e-10;
	static final double pi = Math.PI;
	static StringBuilder sb = new StringBuilder();
	static InputStream is;
	static PrintWriter out;
	static String INPUT = "";

	//libraries
	static void reverse(int ar[]) {
		int len = ar.length;
		for (int i = 0; i < len / 2; i++) {
			int t = ar[i];
			ar[i] = ar[len - 1 - i];
			ar[len - 1 - i] = t;
		}
	}

	static void reverse(long ar[]) {
		int len = ar.length;
		for (int i = 0; i < len / 2; i++) {
			long t = ar[i];
			ar[i] = ar[len - 1 - i];
			ar[len - 1 - i] = t;
		}
	}

	static void reverse(double ar[]) {
		int len = ar.length;
		for (int i = 0; i < len / 2; i++) {
			double t = ar[i];
			ar[i] = ar[len - 1 - i];
			ar[len - 1 - i] = t;
		}
	}

	static void reverse(char ar[]) {
		int len = ar.length;
		for (int i = 0; i < len / 2; i++) {
			char t = ar[i];
			ar[i] = ar[len - 1 - i];
			ar[len - 1 - i] = t;
		}
	}

	static String getReverse(String s) {
		char c[] = s.toCharArray();
		reverse(c);
		s = String.valueOf(c);
		return s;
	}

	static <T> void reverse(List<T> ls) {
		int sz = ls.size();
		for (int i = 0; i < sz / 2; i++) {
			T t = ls.get(i);
			ls.set(i, ls.get(sz - 1 - i));
			ls.set(sz - 1 - i, t);
		}
	}

	static <T> void reverse(T[] ar) {
		int len = ar.length;
		for (int i = 0; i < len / 2; i++) {
			T t = ar[i];
			ar[i] = ar[len - 1 - i];
			ar[len - 1 - i] = t;
		}
	}

	static void sbnl() {//StringBuilderに改行文字をappendする
		sb.append("\n");
	}

	static int lowerBound(int[] a, int x) {
		int l = -1, r = a.length;
		while (r - l > 1) {
			int c = (l + r) / 2;
			if (a[c] < x) {
				l = c;
			} else {
				r = c;
			}
		}
		return r;
	}

	static int upperBound(int[] a, int x) {
		int l = -1, r = a.length;
		while (r - l > 1) {
			int c = (l + r) / 2;
			if (a[c] <= x) {
				l = c;
			} else {
				r = c;
			}
		}
		return r;
	}

	static int rlowerBound(int[] a, int x) {
		int l = -1, r = a.length;
		while (r - l > 1) {
			int c = (l + r) / 2;
			if (a[c] > x) {
				l = c;
			} else {
				r = c;
			}
		}
		return r;
	}

	static int rupperBound(int[] a, int x) {
		int l = -1, r = a.length;
		while (r - l > 1) {
			int c = (l + r) / 2;
			if (a[c] >= x) {
				l = c;
			} else {
				r = c;
			}
		}
		return r;
	}

	static int lowerBound(long[] a, long x) {
		int l = -1, r = a.length;
		while (r - l > 1) {
			int c = (l + r) / 2;
			if (a[c] < x) {
				l = c;
			} else {
				r = c;
			}
		}
		return r;
	}

	static int upperBound(long[] a, long x) {
		int l = -1, r = a.length;
		while (r - l > 1) {
			int c = (l + r) / 2;
			if (a[c] <= x) {
				l = c;
			} else {
				r = c;
			}
		}
		return r;
	}

	static int rlowerBound(long[] a, long x) {
		int l = -1, r = a.length;
		while (r - l > 1) {
			int c = (l + r) / 2;
			if (a[c] > x) {
				l = c;
			} else {
				r = c;
			}
		}
		return r;
	}

	static int rupperBound(long[] a, long x) {
		int l = -1, r = a.length;
		while (r - l > 1) {
			int c = (l + r) / 2;
			if (a[c] >= x) {
				l = c;
			} else {
				r = c;
			}
		}
		return r;
	}

	static int lowerBound(double[] a, double x) {
		int l = -1, r = a.length;
		while (r - l > 1) {
			int c = (l + r) / 2;
			if (a[c] < x) {
				l = c;
			} else {
				r = c;
			}
		}
		return r;
	}

	static int upperBound(double[] a, double x) {
		int l = -1, r = a.length;
		while (r - l > 1) {
			int c = (l + r) / 2;
			if (a[c] <= x) {
				l = c;
			} else {
				r = c;
			}
		}
		return r;
	}

	static int rlowerBound(double[] a, double x) {
		int l = -1, r = a.length;
		while (r - l > 1) {
			int c = (l + r) / 2;
			if (a[c] > x) {
				l = c;
			} else {
				r = c;
			}
		}
		return r;
	}

	static int rupperBound(double[] a, double x) {
		int l = -1, r = a.length;
		while (r - l > 1) {
			int c = (l + r) / 2;
			if (a[c] >= x) {
				l = c;
			} else {
				r = c;
			}
		}
		return r;
	}

	static int lowerBound(char[] a, char x) {
		int l = -1, r = a.length;
		while (r - l > 1) {
			int c = (l + r) / 2;
			if (a[c] < x) {
				l = c;
			} else {
				r = c;
			}
		}
		return r;
	}

	static int upperBound(char[] a, char x) {
		int l = -1, r = a.length;
		while (r - l > 1) {
			int c = (l + r) / 2;
			if (a[c] <= x) {
				l = c;
			} else {
				r = c;
			}
		}
		return r;
	}

	static int rlowerBound(char[] a, char x) {
		int l = -1, r = a.length;
		while (r - l > 1) {
			int c = (l + r) / 2;
			if (a[c] > x) {
				l = c;
			} else {
				r = c;
			}
		}
		return r;
	}

	static int rupperBound(char[] a, char x) {
		int l = -1, r = a.length;
		while (r - l > 1) {
			int c = (l + r) / 2;
			if (a[c] >= x) {
				l = c;
			} else {
				r = c;
			}
		}
		return r;
	}

	static <T> int lowerBound(List<T> ls, T x) throws RuntimeException {
		if (ls.size() == 0)
			return -1;
		if (ls.get(0) instanceof Integer) {
			return ~Collections.binarySearch(ls, x, (t1, t2) -> ((Integer) t1).compareTo((Integer) t2) >= 0 ? 1 : -1);
		} else if (ls.get(0) instanceof Long) {
			return ~Collections.binarySearch(ls, x, (t1, t2) -> ((Long) t1).compareTo((Long) t2) >= 0 ? 1 : -1);
		} else if (ls.get(0) instanceof Double) {
			return ~Collections.binarySearch(ls, x, (t1, t2) -> ((Double) t1).compareTo((Double) t2) >= 0 ? 1 : -1);
		} else {
			System.err.println(
					String.format("%s:数値でないリストを二分探索しています。", Thread.currentThread().getStackTrace()[1].getMethodName()));
			throw new RuntimeException();
		}
	}

	static <T> int upperBound(List<T> ls, T x) throws RuntimeException {
		if (ls.size() == 0)
			return -1;
		if (ls.get(0) instanceof Integer) {
			return ~Collections.binarySearch(ls, x, (t1, t2) -> ((Integer) t1).compareTo((Integer) t2) > 0 ? 1 : -1);
		} else if (ls.get(0) instanceof Long) {
			return ~Collections.binarySearch(ls, x, (t1, t2) -> ((Long) t1).compareTo((Long) t2) > 0 ? 1 : -1);
		} else if (ls.get(0) instanceof Double) {
			return ~Collections.binarySearch(ls, x, (t1, t2) -> ((Double) t1).compareTo((Double) t2) > 0 ? 1 : -1);
		} else {
			System.err.println(
					String.format("%s:数値でないリストを二分探索しています。", Thread.currentThread().getStackTrace()[1].getMethodName()));
			throw new RuntimeException();
		}
	}

	static <T> int rupperBound(List<T> ls, T x) throws RuntimeException {
		if (ls.size() == 0)
			return -1;
		if (ls.get(0) instanceof Integer) {
			return ~Collections.binarySearch(ls, x, (t1, t2) -> ((Integer) t1).compareTo((Integer) t2) < 0 ? 1 : -1);
		} else if (ls.get(0) instanceof Long) {
			return ~Collections.binarySearch(ls, x, (t1, t2) -> ((Long) t1).compareTo((Long) t2) < 0 ? 1 : -1);
		} else if (ls.get(0) instanceof Double) {
			return ~Collections.binarySearch(ls, x, (t1, t2) -> ((Double) t1).compareTo((Double) t2) < 0 ? 1 : -1);
		} else {
			System.err.println(
					String.format("%s:数値でないリストを二分探索しています。", Thread.currentThread().getStackTrace()[1].getMethodName()));
			throw new RuntimeException();
		}
	}

	static <T> int rlowerBound(List<T> ls, T x) {
		if (ls.size() == 0)
			return -1;
		if (ls.get(0) instanceof Integer) {
			return ~Collections.binarySearch(ls, x, (t1, t2) -> ((Integer) t1).compareTo((Integer) t2) <= 0 ? 1 : -1);
		} else if (ls.get(0) instanceof Long) {
			return ~Collections.binarySearch(ls, x, (t1, t2) -> ((Long) t1).compareTo((Long) t2) <= 0 ? 1 : -1);
		} else if (ls.get(0) instanceof Double) {
			return ~Collections.binarySearch(ls, x, (t1, t2) -> ((Double) t1).compareTo((Double) t2) <= 0 ? 1 : -1);
		} else {
			System.err.println(
					String.format("%s:数値でないリストを二分探索しています。", Thread.currentThread().getStackTrace()[1].getMethodName()));
			throw new RuntimeException();
		}
	}

	static int[] concat(int x, int arr[]) {
		int ret[] = new int[arr.length + 1];
		System.arraycopy(arr, 0, ret, 1, ret.length - 1);
		ret[0] = x;
		return ret;
	}

	static int[] concat(int arr[], int x) {
		int ret[] = new int[arr.length + 1];
		System.arraycopy(arr, 0, ret, 0, ret.length - 1);
		ret[ret.length - 1] = x;
		return ret;
	}

	static long[] concat(long x, long arr[]) {
		long ret[] = new long[arr.length + 1];
		System.arraycopy(arr, 0, ret, 1, ret.length - 1);
		ret[0] = x;
		return ret;
	}

	static long[] concat(long arr[], long x) {
		long ret[] = new long[arr.length + 1];
		System.arraycopy(arr, 0, ret, 0, ret.length - 1);
		ret[ret.length - 1] = x;
		return ret;
	}

	static int max(int x, int y) {
		return Math.max(x, y);
	}

	static int min(int x, int y) {
		return Math.min(x, y);
	}

	static int max(int x, int y, int z) {
		x = Math.max(x, y);
		x = Math.max(x, z);
		return x;
	}

	static int min(int x, int y, int z) {
		x = Math.min(x, y);
		x = Math.min(x, z);
		return x;
	}

	static long max(long x, long y) {
		return Math.max(x, y);
	}

	static long min(long x, long y) {
		return Math.min(x, y);
	}

	static long max(long x, long y, long z) {
		x = Math.max(x, y);
		x = Math.max(x, z);
		return x;
	}

	static long min(long x, long y, long z) {
		x = Math.min(x, y);
		x = Math.min(x, z);
		return x;
	}

	static double max(double x, double y) {
		return Math.max(x, y);
	}

	static double min(double x, double y) {
		return Math.min(x, y);
	}

	static double max(double x, double y, double z) {
		x = Math.max(x, y);
		x = Math.max(x, z);
		return x;
	}

	static double min(double x, double y, double z) {
		x = Math.min(x, y);
		x = Math.min(x, z);
		return x;
	}

	static void sort(int[] ar) {
		Arrays.sort(ar);
	}

	static void sort(long[] ar) {
		Arrays.sort(ar);
	}

	static void sort(double[] ar) {
		Arrays.sort(ar);
	}

	static void sort(char[] ar) {
		Arrays.sort(ar);
	}

	static void rsort(int[] ar) {
		Arrays.sort(ar);
		int len = ar.length;
		for (int i = 0; i < len / 2; i++) {
			int tmp = ar[i];
			ar[i] = ar[len - 1 - i];
			ar[len - 1 - i] = tmp;
		}
	}

	static void rsort(long[] ar) {
		Arrays.sort(ar);
		int len = ar.length;
		for (int i = 0; i < len / 2; i++) {
			long tmp = ar[i];
			ar[i] = ar[len - 1 - i];
			ar[len - 1 - i] = tmp;
		}
	}

	static void rsort(double[] ar) {
		Arrays.sort(ar);
		int len = ar.length;
		for (int i = 0; i < len / 2; i++) {
			double tmp = ar[i];
			ar[i] = ar[len - 1 - i];
			ar[len - 1 - i] = tmp;
		}
	}

	static void rsort(char[] ar) {
		Arrays.sort(ar);
		int len = ar.length;
		for (int i = 0; i < len / 2; i++) {
			char tmp = ar[i];
			ar[i] = ar[len - 1 - i];
			ar[len - 1 - i] = tmp;
		}
	}

	static void fill(int arr[], int x) {
		Arrays.fill(arr, x);
	}

	static void fill(long arr[], long x) {
		Arrays.fill(arr, x);
	}

	static void fill(boolean arr[], boolean x) {
		Arrays.fill(arr, x);
	}

	static void fill(double arr[], double x) {
		Arrays.fill(arr, x);
	}

	static void fill(int arr[][], int x) {
		for (int i = 0; i < arr.length; i++)
			Arrays.fill(arr[i], x);
	}

	static void fill(long arr[][], long x) {
		for (int i = 0; i < arr.length; i++)
			Arrays.fill(arr[i], x);
	}

	static void fill(double arr[][], double x) {
		for (int i = 0; i < arr.length; i++)
			Arrays.fill(arr[i], x);
	}

	static void fill(boolean arr[][], boolean x) {
		for (int i = 0; i < arr.length; i++)
			Arrays.fill(arr[i], x);
	}

	//MOD culc
	static long plus(long x, long y) {
		long res = (x + y) % mod;
		return res < 0 ? res + mod : res;
	}

	static long sub(long x, long y) {
		long res = (x - y) % mod;
		return res < 0 ? res + mod : res;
	}

	static long mul(long x, long y) {
		long res = (x * y) % mod;
		return res < 0 ? res + mod : res;
	}

	static long div(long x, long y) {
		long res = x * pow(y, mod - 2) % mod;
		return res < 0 ? res + mod : res;
	}

	static long pow(long x, long y) {
		if (y < 0)
			return 0;
		if (y == 0)
			return 1;
		if (y % 2 == 1)
			return (x * pow(x, y - 1)) % mod;
		long root = pow(x, y / 2);
		return root * root % mod;
	}

	public static void main(String[] args) throws Exception {
		is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);
		solve();
		out.flush();
	}

	//input
	private static byte[] inbuf = new byte[1024];
	static int lenbuf = 0, ptrbuf = 0;

	private static int readByte() {
		if (lenbuf == -1)
			throw new InputMismatchException();
		if (ptrbuf >= lenbuf) {
			ptrbuf = 0;
			try {
				lenbuf = is.read(inbuf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (lenbuf <= 0)
				return -1;
		}
		return inbuf[ptrbuf++];
	}

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

	private static int skip() {
		int b;
		while ((b = readByte()) != -1 && isSpaceChar(b))
			;
		return b;
	}

	@SuppressWarnings("unused")
	private static double nd() {
		return Double.parseDouble(ns());
	}

	@SuppressWarnings("unused")
	private static char nc() {
		return (char) skip();
	}

	private static String ns() {
		int b = skip();
		StringBuilder sb = new StringBuilder();
		while (!(isSpaceChar(b))) {
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	private static char[] ns(int n) {
		char[] buf = new char[n];
		int b = skip(), p = 0;
		while (p < n && !(isSpaceChar(b))) {
			buf[p++] = (char) b;
			b = readByte();
		}
		return n == p ? buf : Arrays.copyOf(buf, p);
	}

	@SuppressWarnings("unused")
	private static char[][] nm(int n, int m) {
		char[][] map = new char[n][];
		for (int i = 0; i < n; i++)
			map[i] = ns(m);
		return map;
	}

	@SuppressWarnings("unused")
	private static int[] na(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = ni();
		return a;
	}

	@SuppressWarnings("unused")
	private static long[] nla(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = nl();
		return a;
	}

	private static int ni() {
		int num = 0, b;
		boolean minus = false;
		while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
			;
		if (b == '-') {
			minus = true;
			b = readByte();
		}

		while (true) {
			if (b >= '0' && b <= '9') {
				num = num * 10 + (b - '0');
			} else {
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	@SuppressWarnings("unused")
	private static long nl() {
		long num = 0;
		int b;
		boolean minus = false;
		while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
			;
		if (b == '-') {
			minus = true;
			b = readByte();
		}

		while (true) {
			if (b >= '0' && b <= '9') {
				num = num * 10 + (b - '0');
			} else {
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

}


import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.*;
import java.io.*;
public class Main {
InputStream is;
	PrintWriter out;
	String INPUT = "";
//class  Declaration

static class pair implements Comparable<pair>{
	int x;
	int y;

	pair (int i,int j)
	{ x=i; y=j;

	}
	public int compareTo(pair p){
		if(this.x!=p.x) { return this.x-p.x;}
		else { return this.y-p.y;}
	}
	public int hashCode() { return (x+" "+y).hashCode();}
	public String toString(){ return x+" "+y;}
	public boolean equals(Object o){
		pair x = (pair) o ;
		return (x.x==this.x&&x.y==this.y);}
}

int inf = (int)1e9 + 5;
long mod = (long)1e9 + 7;
long[] power ;
long prime = 31 ;

void solve() throws Exception{
	int n=ni(),m=ni();
	boolean[] solved = new boolean[n+1];
	int[] cost=  new int[n+1];
	for(int i=0;i<m;++i){
		int p = ni();
		String ver = ns();
		if(!solved[p]){
		if(ver.equals("WA")){
			cost[p]++;
		}
		else{
			solved[p] = true ;
		}
		}
	}
	int cnt = 0,penalty = 0;
	for(int i=1;i<=n;++i){
		if(solved[i]){
			cnt++;
			penalty+=cost[i];
		}
	}
	pn(cnt+" "+penalty);
}

long pow(long a,long b){
	long result = 1;
	while(b>0){
	if(b%2==1) result = (result * a) % mod;
		b/=2;
		a=(a*a)%mod;
	}
	return result;
}

void print(Object o){
System.out.println(o);
System.out.flush();
}

long gcd(long a, long b)
{
if (b == 0)
return a;
return gcd(b, a % b);
}
void run() throws Exception{
		is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());
out = new PrintWriter(System.out);

		long s = System.currentTimeMillis();
		solve();
		out.flush();
		if(!INPUT.isEmpty())tr(System.currentTimeMillis()-s+"ms");
}

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

//output methods
private void pn(Object o)
{
	out.println(o);
}
private void p(Object o)
{
	out.print(o);
}

//input methods
		private byte[] inbuf = new byte[1024];
	public int lenbuf = 0, ptrbuf = 0;

	private int readByte()
	{
		if(lenbuf == -1)throw new InputMismatchException();
		if(ptrbuf >= lenbuf){
			ptrbuf = 0;
			try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }
			if(lenbuf <= 0)return -1;
		}
		return inbuf[ptrbuf++];
	}

	private boolean isSpaceChar(int c) { return !(c >= 33 && c <= 126); }
	private int skip() { int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }

	private double nd() { return Double.parseDouble(ns()); }
	private char nc() { return (char)skip(); }

	private String ns()
	{
		int b = skip();
		StringBuilder sb = new StringBuilder();
		while(!(isSpaceChar(b))){ // when nextLine, (isSpaceChar(b) && b != ' ')
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	private char[] ns(int n)
	{
		char[] buf = new char[n];
		int b = skip(), p = 0;
		while(p < n && !(isSpaceChar(b))){
			buf[p++] = (char)b;
			b = readByte();
		}
		return n == p ? buf : Arrays.copyOf(buf, p);
	}

	private char[][] nm(int n, int m)
	{
		char[][] map = new char[n][];
		for(int i = 0;i < n;i++)map[i] = ns(m);
		return map;
	}

	private int[] na(int n)
	{
		int[] a = new int[n];
		for(int i = 0;i < n;i++)a[i] = ni();
		return a;
	}

	private int ni()
	{
		int num = 0, b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}

		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private long nl()
	{
		long num = 0;
		int b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}

		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private void tr(Object... o) { if(INPUT.length() > 0)System.out.println(Arrays.deepToString(o)); }
	void watch(Object ... a) throws Exception{
		int i=1;
		print("watch starts :");
		for(Object o : a ) {
			//print(o);
			boolean notfound = true;
			if(o.getClass().isArray()){

				String type = o.getClass().getName().toString();
				//print("type is "+type);
				switch (type) {
					case "[I":{
						int[] test = (int[])o ;
						print(i+" "+Arrays.toString(test));
						break;
					}
					case "[[I":{
						int[][] obj = (int[][])o;

						print(i+" "+Arrays.deepToString(obj));
						break;
					}
					case "[J" : {

						long[] obj  = (long[])o ;
						print(i+" "+Arrays.toString(obj));
						break;
					}
					case "[[J": {

						long[][] obj = (long[][])o;
						print(i+" "+Arrays.deepToString(obj));
						break;
					}
					case "[D" :{

						double[] obj= (double[])o;
						print(i+" "+Arrays.toString(obj));
						break;
					}
					case "[[D" :{

						double[][] obj = (double[][])o;
						print(i+" "+Arrays.deepToString(obj));
						break;
					}
					case "[Ljava.lang.String": {

						String[] obj = (String[])o ;
						print(i+" "+Arrays.toString(obj));
						break;
					}
					case "[[Ljava.lang.String": {

						String[][] obj = (String[][])o ;
						print(i+" "+Arrays.deepToString(obj));
						break ;
					}
					case "[C" :{
						char[] obj = (char[])o ;
						print(i+" "+Arrays.toString(obj));
						break;
					}
					case "[[C" :{

						char[][] obj = (char[][])o;
						print(i+" "+Arrays.deepToString(obj));
						break;
					}

					default:{
						print(i+" type not identified");
						break;
					}
				}
				notfound = false;

			}
			if(o.getClass() == ArrayList.class){
				print(i+" al: "+o);
				notfound = false;
			}
			if(o.getClass() == HashSet.class){
				print(i+" hs: "+o);
				notfound = false;
			}
			if(o.getClass() == TreeSet.class){
				print(i+" ts: "+o);
				notfound = false;
			}
			if(o.getClass() == TreeMap.class){
				print(i+" tm: "+o);
				notfound = false;
			}
			if(o.getClass() == HashMap.class){
				print(i+" hm: "+o);
				notfound = false;
			}
			if(o.getClass() == LinkedList.class){
				print(i+" ll: "+o);
				notfound = false;
			}
			if(o.getClass() == PriorityQueue.class){
				print(i+" pq : "+o);
				notfound = false;
			}
			if(o.getClass() == pair.class){
				print(i+" pq : "+o);
				notfound = false;
			}

			if(notfound){
				print(i+" unknown: "+o);
			}
			i++;
		}
		print("watch ends ");
	}

}


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

public class Main implements Runnable {

    long m = (int)1e9+7;
    PrintWriter rw;
    ArrayList<Integer> prime;
    boolean is_prime[];
    InputReader sc;
    public void run() {
        sc = new InputReader(System.in);
        rw = new PrintWriter(System.out);

        int n = sc.nextInt();
        int m = sc.nextInt();
        boolean[] visited = new boolean[n];
        int cntAC = 0;
        int[] cntWA = new int[n];
        for(int i = 0; i < m; i++){
            int p = sc.nextInt() - 1;
            String s = sc.next();
            if(s.equals("AC")){
                if(!visited[p]) {
                    visited[p] = true;
                    cntAC++;
                }
            } else{
                if(!visited[p]){
                 cntWA[p]++;
                }
            }
        }
        int penalty = 0;
        for(int i = 0; i < n; i++){
            if(visited[i]){
                penalty += cntWA[i];
            }
        }
        rw.print(cntAC + " " + penalty);
        rw.close();
    }

    private static int maxIndex(List<Integer> list) {
        Integer i=0, maxIndex=-1, max=null;
        for (Integer x : list) {
            if ((x!=null) && ((max==null) || (x>max))) {
                max = x;
                maxIndex = i;
            }
            i++;
        }
        return maxIndex;
    }

    public int[] merge(int[] left, int[] right, int[] a){
        int nLeft = left.length;
        int nRight = right.length;
        int i = 0, j = 0, k = 0;
        while(i < nLeft && j < nRight) {
            if (left[i] <= right[j]) {
                a[k] = left[i];
                k++;
                i++;
            } else {
                a[k] = right[j];
                k++;
                j++;
            }
        }
        while (i < nLeft) {
            a[k] = left[i];
            i++;
            k++;
        }
        while (j < nRight) {
            a[k] = right[j];
            j++;
            k++;
        }
        return a;
    }

    public int[] mergeSort(int[] a){
        int n = a.length;
        if(n < 2){
            return a;
        }
        int mid = n/2;
        int[] left = new int[mid];
        int[] right = new int[n-mid];
        for(int i = 0; i < mid; i++){
            left[i] = a[i];
        }
        for(int i = mid; i < n; i++){
            right[i-mid] = a[i];
        }
        mergeSort(left);
        mergeSort(right);
        merge(left,right,a);
        return a;
    }

    static int largest(int[] arr) {
        int i;
        int max = arr[0];
        for (i = 1; i < arr.length; i++)
            if (arr[i] > max)
                max = arr[i];
        return max;
    }

    static long gcd(long a, long b) {
        if (b == 0)
            return a;
        return gcd(b, a % b);
    }
    void sieve(int n) {
        is_prime = new boolean[n+10];
        prime = new ArrayList<>();
        for(int i=2;i<=n;i++)
            is_prime[i] = true;

        for (int i = 2; i <= n; ++i) {
            if (is_prime[i]) prime.add(i);
            for (int j = 0; j < prime.size () && i * prime.get(j) < n; ++j) {
                is_prime[i * prime.get(j)] = false;
                if (i % prime.get(j) == 0) break;
            }
        }
    }
    public static void sortbyColumn(int arr[][], int col){
        Arrays.sort(arr, new Comparator<int[]>()
        {
            public int compare(int[] o1, int[] o2){
                return(Integer.valueOf(o1[col]).compareTo(o2[col]));
            }
        });

    }
    public static class DJSet {
        public int[] upper;

        public DJSet(int n) {
            upper = new int[n];
            Arrays.fill(upper, -1);
        }

        public int root(int x) {
            return upper[x] < 0 ? x : (upper[x] = root(upper[x]));
        }

        public boolean equiv(int x, int y) {
            return root(x) == root(y);
        }

        public boolean union(int x, int y) {
            x = root(x);
            y = root(y);
            if (x != y) {
                if (upper[y] < upper[x]) {
                    int d = x;
                    x = y;
                    y = d;
                }
                upper[x] += upper[y];
                upper[y] = x;
            }
            return x == y;
        }
    }
    public static int[] radixSort(int[] f)    {
        int[] to = new int[f.length];
        {
            int[] b = new int[65537];
            for(int i = 0;i < f.length;i++)b[1+(f[i]&0xffff)]++;
            for(int i = 1;i <= 65536;i++)b[i]+=b[i-1];
            for(int i = 0;i < f.length;i++)to[b[f[i]&0xffff]++] = f[i];
            int[] d = f; f = to;to = d;
        }
        {
            int[] b = new int[65537];
            for(int i = 0;i < f.length;i++)b[1+(f[i]>>>16)]++;
            for(int i = 1;i <= 65536;i++)b[i]+=b[i-1];
            for(int i = 0;i < f.length;i++)to[b[f[i]>>>16]++] = f[i];
            int[] d = f; f = to;to = d;
        }
        return f;
    }

    public void printArray(int[] a){
        for(int i=0;i<a.length;i++)
            rw.print(a[i]+" ");
        rw.println();
    }
    public int[] scanArrayI(int n){
        int[] a = new int[n];
        for(int i=0;i<n;i++)
            a[i] = sc.nextInt();
        return a;
    }

    public int[][] scan2dArrayI(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;
    }
    public void print2dArrayI(int[][] a){
        for(int i = 0; i < a.length; i++){
            for(int j = 0; j < a.length; j++){
                rw.print(a[i][j] + " ");
            }
            rw.println();
        }
    }
    public long[] scanArrayL(int n){
        long[] a = new long[n];
        for(int i=0;i<n;i++)
            a[i] = sc.nextLong();
        return a;
    }
    public void printArray(long[] a){
        for(int i=0;i<a.length;i++)
            rw.print(a[i]+" ");
        rw.println();
    }
    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private SpaceCharFilter filter;
        private BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

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

        public int read() {
            if (numChars==-1)
                throw new InputMismatchException();

            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                }
                catch (IOException e) {
                    throw new InputMismatchException();
                }

                if(numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            }
            catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
        public int nextInt() {
            int c = read();

            while(isSpaceChar(c))
                c = read();

            int sgn = 1;

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

            int res = 0;
            do {
                if(c<'0'||c>'9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c));

            return res * sgn;
        }

        public long nextLong() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;

            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c));
            return res * sgn;
        }

        public double nextDouble() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            double res = 0;
            while (!isSpaceChar(c) && c != '.') {
                if (c == 'e' || c == 'E')
                    return res * Math.pow(10, nextInt());
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            if (c == '.') {
                c = read();
                double m = 1;
                while (!isSpaceChar(c)) {
                    if (c == 'e' || c == 'E')
                        return res * Math.pow(10, nextInt());
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    m /= 10;
                    res += (c - '0') * m;
                    c = read();
                }
            }
            return res * sgn;
        }

        public String readString() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            }
            while (!isSpaceChar(c));

            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public String next() {
            return readString();
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
    }
    public static void main(String args[]) throws Exception {
        new Thread(null, new Main(),"Main",1<<26).start();
    }
}


import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int m = sc.nextInt();
    int ac = 0;
    int wa = 0;
    boolean[] end = new boolean[n+2];
    for(int i = 0;i<m;i++){
      int p = sc.nextInt();
      String s = sc.next();
      if(end[p]){
        continue;
      }else if(s.equals("AC")){
        end[p] = true;
        ac++;
      }else{
        wa++;
      }
    }
    System.out.println(ac);
    System.out.println(wa);
  }
}


import java.util.HashSet;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in)) {
            int N = sc.nextInt();
            int M = sc.nextInt();
            int[] p = new int[M];
            String[] S = new String[M];
            for (int i = 0; i < M; i++) {
                p[i] = sc.nextInt();
                S[i] = sc.next();
            }

            HashSet<Integer> setAC = new HashSet<Integer>();
            int countWA = 0;
            for (int i = 0; i < M; i++) {
                if (!setAC.contains(p[i])) {
                    if (S[i].equals("WA")) {
                        countWA++;
                    }
                }
                if (S[i].equals("AC")) {
                    setAC.add(p[i]);
                }
            }

            System.out.println(setAC.size() + " " + countWA);
        }
    }
}


import java.util.*;

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

        int a = sc.nextInt();
        int b = sc.nextInt();
        int[] q = new int[b];
        String[] ans = new String[b];
        int[] c = new int[b];
        int wa=0;
        int ac=0;

        for(int i=0; i<b; i++){
            q[i] = sc.nextInt();
            ans[i] = sc.next();
            c[i] = 0;
        }

        int x=0;
        for(int i=0; i<b; i++){
            if(ans[i].equals("WA") && c[x]!=q[i]){
                wa++;
                //System.out.println(""+q[i]+c[x]);
            }else{
                if(c[x]!=q[i]){
                    ac++;
                    x++;
                    c[x]= q[i];
                }
            }
        }

        System.out.println(""+ac+" "+wa);
   }
}