import Foundation
let main: () = {
    let S = next().map { $0.asciiCode - 48 }.reversed()
    var cnt = IntArray(2019)
    var total = 0
    var p = 1
    var ans = 0
    for s in S {
        cnt[total] += 1
        total = (total + s * p) % 2019
        ans += cnt[total]
        p = p * 10 % 2019
    }
    print(ans)
}()

//----------------------------------

let dx = [1, 0, -1, 0] //[1, 0, -1, 0, -1,  1, -1, 1]
let dy = [0, 1, 0, -1] //[0, 1, 0, -1, -1, -1,  1, 1]

@inlinable func gcd(_ a: Int, _ b: Int) -> Int { (b > 0) ? gcd(b, a % b) : a }
@inlinable func lcm(_ a: Int, _ b: Int) -> Int { a / gcd(a, b) * b }

//----------------------------------

infix operator  =~ : ComparisonPrecedence
infix operator !=~ : ComparisonPrecedence
func =~ <T: FixedWidthInteger>(left: T, right: Range<T>) -> Bool { right ~= left }
func !=~ <T: FixedWidthInteger>(left: T, right: Range<T>) -> Bool { !(right ~= left) }
func =~ <T: FixedWidthInteger>(left: T, right: ClosedRange<T>) -> Bool { right ~= left }
func !=~ <T: FixedWidthInteger>(left: T, right: ClosedRange<T>) -> Bool { !(right ~= left) }

func =~ <T: Collection > (left: T.Element, right: T) -> Bool where T.Element : Equatable { right.contains(left) }
func !=~ <T: Collection > (left: T.Element, right: T) -> Bool where T.Element : Equatable { !right.contains(left) }

infix operator /^ : MultiplicationPrecedence
infix operator /^= : AssignmentPrecedence
func /^ <T: FixedWidthInteger>(left: T, right: T) -> T { (left + (right - 1)) / right }
func /^= <T: FixedWidthInteger>(left: inout T, right: T) { left = (left + (right - 1)) / right }

@inlinable func chmax<T: Comparable>(_ m: inout T, _ q: T) { if (m < q) { m = q } }
@inlinable func chmin<T: Comparable>(_ m: inout T, _ q: T) { if (m > q) { m = q } }
@inlinable func chRmax<T: Comparable>(_ m: inout T, _ q: T) -> Bool { if (m < q) { m = q; return true } else { return false } }
@inlinable func chRmin<T: Comparable>(_ m: inout T, _ q: T) -> Bool { if (m > q) { m = q; return true } else { return false } }

prefix operator *
prefix func * <T> (a: [T]) -> (T, T) { (a[0], a[1]) }
prefix func * <T> (a: [T]) -> (T, T, T) { (a[0], a[1], a[2]) }
prefix func * <T> (a: [T]) -> (T, T, T, T) { (a[0], a[1], a[2], a[3]) }
prefix func * <T> (a: [T]) -> (T, T, T, T, T) { (a[0], a[1], a[2], a[3], a[4]) }
prefix func * <T> (a: [T]) -> (T, T, T, T, T, T) { (a[0], a[1], a[2], a[3], a[4], a[5]) }

func printErr(_ str: String, terminator: String = "\n") {
    let s = str + terminator
    FileHandle.standardError.write(s.data(using: .utf8)!)
    FileHandle.standardError.synchronizeFile()
}

@inlinable func next() -> String { readLine()! }
@inlinable func nextInt() -> Int { Int(next())! }
@inlinable func nextDouble() -> Double { Double(next())! }
@inlinable func listOfString() -> [String] { next().split(separator: " ").map(String.init) }
@inlinable func listOfInt() -> [Int] { listOfString().map { Int($0)! } }
@inlinable func listOfInt(_ offset: Int = 0) -> [Int] { listOfString().map { Int($0)! + offset } }
@inlinable func listOfInt(_ offsets: Int ...) -> [Int] { listOfString().enumerated().map { Int($0.element)! + offsets[$0.offset % offsets.count] } }
@inlinable func listOfDouble(_ offset: Double = 0.0) -> [Double] { listOfString().map { Double($0)! + offset } }
@inlinable func listOfDouble(_ offsets: Double ...) -> [Double] { listOfString().enumerated().map { Double($0.element)! + offsets[$0.offset % offsets.count] } }

extension Int {
    init(s: String) { self.init(s)! }
    var isEven: Bool { self.isMultiple(of: 2) }
    var isOdd: Bool { !self.isEven }
    var isTrue: Bool { self != 0 }
    var isFalse: Bool { !self.isTrue }
    var toString: String { String(self) }
}
func + (left: Int, right: Bool) -> Int { left + (right ? 1 : 0) }
extension Character {
    var asciiCode: Int { Int(self.asciiValue!) }
    var string: String { String(self) }
}
extension String {
    @inlinable subscript (position: Int) -> Character { self[self.index(self.startIndex, offsetBy: position)] }
    @inlinable func repeate(_ times: Int) -> String { String(repeating: self, count: times) }
    //  @inlinable subscript (n: Int) -> String { String(self[self.index(self.startIndex, offsetBy: n)]) }
    //  @inlinable subscript (n: Int) -> Int { Int(self[self.index(self.startIndex, offsetBy: n)].asciiValue!) }
    var toInt: Int { Int(self)! }
}
extension String { // VB like
    @inlinable func _index(_ position: Int) -> String.Index! {
        if !(0 ..< self.count ~= position) { return nil }
        return self.index(self.startIndex, offsetBy: position)
    }
    @inlinable func mid(from index: Int, length: Int) -> String! {
        if let startPosition = self._index(index) {
            if let endPosition = self._index(index + length - 1) {
                return String(self[startPosition...endPosition])
            } else {
                let endPosition = self.index(before: self.endIndex)
                return String(self[startPosition...endPosition])
            }
        }
        return ""
    }
    @inlinable func left(_ length: Int) -> String { String(self.prefix(length)) }
    @inlinable func right(_ length: Int) -> String { String(self.suffix(length)) }
}

extension Dictionary {
    @inlinable mutating func getOrSet(_ key: Key, _ defaultValue: () -> Value) -> Value {
        if let stored = self[key] { return stored }
        else {
            let newValue = defaultValue()
            self[key] = newValue
            return newValue
        }
    }
    @inlinable mutating func getOrElse(_ key: Key, _ defaultValue: () -> Value) -> Value {
        if let stored = self[key] { return stored } else { return defaultValue() }
    }
}

extension Array {
    init(_ size: Int, _ initValue: ((Int) -> Element)) {
        self = [Element]()
        for index in 0 ..< size {
            let value = initValue(index)
            self.append(value)
        }
    }
    init(_ size: Int, _ initValue: (() -> Element)) {
        self = [Element]()
        for _ in 0 ..< size {
            let value = initValue()
            self.append(value)
        }
    }
}
typealias IntArray = Array<Int>
typealias DoubleArray = Array<Double>
typealias BoolArray = Array<Bool>
typealias StringArray = Array<String>

extension Array where Element == Int {
    init(_ size: Int) {
        self = [Element](repeating: 0, count: size)
    }
}
extension Array where Element == Double {
    init(_ size: Int) {
        self = [Element](repeating: 0.0, count: size)
    }
}
extension Array where Element == Bool {
    init(_ size: Int) {
        self = [Element](repeating: false, count: size)
    }
}
extension Array where Element == String {
    init(_ size: Int) {
        self = [Element](repeating: "", count: size)
    }
}

extension Array {
    @inlinable func count(_ predicate: ((Element) -> Bool)) -> Int {
        var cnt = 0; for e in self { if (predicate(e)) { cnt += 1 } }
        return cnt
    }
    @inlinable func groupBy<K>(_ keySelector: (Element) -> K) -> [K : [Element]] {
        var destination = [K : [Element]]()
        for element in self {
            let key = keySelector(element)
            var list = destination.getOrSet(key) { [Element]() }
            list.append(element)
            destination[key] = list
        }
        return destination
    }
    @inlinable func groupByIndexed<K>(_ keySelector: (Element) -> K) -> [K : [Int]] {
        var destination = [K : [Int]]()
        for element in self.enumerated() {
            let key = keySelector(element.element)
            var list = destination.getOrSet(key) { [Int]() }
            list.append(element.offset)
            destination[key] = list
        }
        return destination
    }
}

extension Array {
    func binarySearch(_ element: Element, by compare: (Element, Element) -> Int, fromIndex: Int = 0, toIndex: Int = -1) -> Int {
        var low = fromIndex
        var high = (toIndex == -1) ? self.count - 1 : toIndex - 1
        while (low <= high) {
            let mid = (low + high) >> 1 // safe from overflows
            let midVal = self[mid]
            let cmp = compare(midVal, element)
            if (cmp < 0) { low = mid + 1 }          //-1
            else if (0 < cmp) { high = mid - 1 }    // 1
            else { return mid } // key found        // 0
        }
        return -(low + 1)  // key not found
    }
}
extension Array where Element : Comparable {
    func binarySearch(_ element: Element, fromIndex: Int = 0, toIndex: Int = -1) -> Int {
        var low = fromIndex
        var high = (toIndex == -1) ? self.count - 1 : toIndex - 1
        while (low <= high) {
            let mid = (low + high) >> 1 // safe from overflows
            let midVal = self[mid]
            if (midVal < element) { low = mid + 1 }
            else if (midVal > element) { high = mid - 1 }
            else { return mid } // key found
        }
        return -(low + 1)  // key not found
    }
}

extension Array where Element == Int {
    @inlinable func distinct() -> [Element] {
        var set = Set<Element>(), ary = [Element]()
        for n in self.indices { if !set.contains(self[n]) { ary.append(self[n]); set.insert(self[n]) } }
        return ary
    }
    @inlinable func any(_ predicate: (Element) -> Bool) -> Bool {
        var any = false; for element in self { if predicate(element) { any = true } }
        return any
    }
    @inlinable func all(_ predicate: (Element) -> Bool) -> Bool {
        self.allSatisfy(predicate)
    }
    @inlinable func sum() -> Element { self.reduce(0, +) }
    @inlinable func sum(by predicate: (Element) -> Element) -> Element {
        var sum = 0; for e in self { sum += predicate(e) }
        return sum
    }
    @inlinable func joinToString(_ sepatator: String = " ") -> String { self.map { String($0) }.joined(separator: sepatator) }
}

extension Array where Element == Double {
    @inlinable func sum() -> Element { self.reduce(0.0, +) }
    @inlinable func sum(by predicate: (Element) -> Element) -> Element {
        var sum = 0.0; for e in self { sum += predicate(e) }
        return sum
    }
    @inlinable func joinToString(_ sepatator: String = " ") -> String { self.map { String($0) }.joined(separator: sepatator) }
}
extension Array where Element == String {
    @inlinable func toIntDouble() -> (Int, Double) { (Int(self[0])!, Double(self[1])!) }
    @inlinable func toIntString() -> (Int, String) { (Int(self[0])!, self[1]) }
    @inlinable func toIntIntString() -> (Int, Int, String) { (Int(self[0])!, Int(self[1])!, self[2]) }
}

@inlinable func repeate(_ times1: Int, _ action: () -> Void) {
    for _ in 0 ..< times1 { action() }
}
@inlinable func repeate(_ times1: Int, _ action: (Int) -> Void) {
    for index1 in 0 ..< times1 {
        action(index1)
    }
}
@inlinable func repeate(_ times1: Int, _ times2: Int, _ action: (Int, Int) -> Void) {
    for index1 in 0 ..< times1 {
        for index2 in 0 ..< times2 {
            action(index1, index2)
        }
    }
}
@inlinable func repeate(_ times1: Int, _ times2: Int, _ times3: Int, _ action: (Int, Int, Int) -> Void) {
    for index1 in 0 ..< times1 {
        for index2 in 0 ..< times2 {
            for index3 in 0 ..< times3 {
                action(index1, index2, index3)
            }
        }
    }
}
@inlinable func repeate(_ times1: Int, _ times2: Int, _ times3: Int, _ times4: Int, _ action: (Int, Int, Int, Int) -> Void) {
    for index1 in 0 ..< times1 {
        for index2 in 0 ..< times2 {
            for index3 in 0 ..< times3 {
                for index4 in 0 ..< times4 {
                    action(index1, index2, index3, index4)
                }
            }
        }
    }
}

func measureTimeSeconds(block: (() -> Void)) -> Double {
    let startTime = Date()
    block()
    let duration = -startTime.timeIntervalSinceNow
    return duration
}

class SimpleScanner {
    private var cnt = 0
    private var lines = [String]()
    private var fileName = ""
    private let file: FileHandle
    init(_ filename: String = "") {
        if !filename.isEmpty {
            fileName = filename
            file = FileHandle(forReadingAtPath: fileName)!
        } else {
            file = FileHandle.standardInput
        }
        let contentData = file.readDataToEndOfFile()
        let contentString = String(data: contentData, encoding: .utf8) ?? ""
        lines = contentString.split(separator: "\n").map { String($0) }
        cnt = -1
    }
    deinit {
        if !fileName.isEmpty {
            file.closeFile()
        }
    }
    func next() -> String { cnt += 1; return lines[cnt] }
    func nextInt() -> Int { Int(next())! }
    func nextDouble() -> Double { Double(next())! }
    func listOfString() -> [String] { next().split(separator: " ").map { String($0) } }
    func listOfInt(_ offset: Int = 0) -> [Int] { listOfString().map { Int($0)! + offset } }
    func listOfInt(_ offsets: Int ...) -> [Int] { listOfString().enumerated().map { Int($0.element)! + offsets[$0.offset % offsets.count] } }
    func listOfDouble(_ offset: Double = 0.0) -> [Double] { listOfString().map { Double($0)! + offset } }
    func listOfDouble(_ offsets: Double ...) -> [Double] { listOfString().enumerated().map { Double($0.element)! + offsets[$0.offset % offsets.count] } }
}

struct RingArray<T> {
    private var array: [T?]
    init(_ size: Int) { self.array = [T?](repeating: nil, count: size) }
    init(_ source: [T]) { self.array = source }
    var count: Int { array.count }
    var indices: Range<Int> { array.indices }
    subscript(_ index: Int) -> T {
        get{ array[(index + array.count) % array.count]! }
        set (newValue) { array[(index + array.count) % array.count] = newValue }
    }
    func toOffsetArray(offset: Int) -> [T] {
        let tmp = array[offset % array.count ..< array.count] + array[0 ..< offset % array.count]
        return tmp.map { $0!}
    }
    func toArray() -> [T] { array.map { $0! } }
}


let mod = 2019

let S = readLine()!
var place = 1
var remainder = 0
var count = Array(repeating: 0, count: mod)
count[0] = 1
for char in S.reversed() {
    remainder += place * Int(String(char))!
    remainder %= mod
    count[remainder] += 1
    place = place * 10 % mod
}

var ans = 0
count.forEach({m in ans += m * (m - 1) / 2})
print(ans)


extension Int {
    func pow(_ x: Int) -> Int {
        if x < 1 { fatalError() }
        var base = 1
        for _ in 1...x {
            base *= self
        }
        return base
    }
}

extension Collection where Element == Int {
    func createN() -> Int {
        self.reversed()
            .enumerated()
            .reduce(0) { $0 + $1.element.pow($1.offset) }
    }
}

let S = readLine()!.map { $0.wholeNumberValue! }

var r = 0
for i in S.indices {
    var s = S[i...]

    while let j = s.index(i, offsetBy: 5, limitedBy: s.endIndex) {
        let a = s.createN()
        let b = a % 2019
        if b == 0 { r += 1 }
        s.replaceSubrange(i..<j, with: String(b).map { $0.wholeNumberValue! })
    }

    if s != [0] && s.createN().isMultiple(of: 2019) {
        r += 1
    }
}

print(r)


let S = readLine()!

var r = 0
for i in S.indices {
    var s = S[i...]

    while let j = s.index(i, offsetBy: 5, limitedBy: s.endIndex) {
        let a = Int(s[i..<j])!
        let b = a % 2019
        if b == 0 { r += 1 }
        s.replaceSubrange(i..<j, with: String(b))
    }

    if s != "0" && Int(s)!.isMultiple(of: 2019) {
        r += 1
    }
}

print(r)


let S = readLine()!

var r = 0
for i in S.indices {
    var s = S[i...]

    let sum = s.reduce(0) { $0 + $1.wholeNumberValue! }
    if !sum.isMultiple(of: 3) {
        continue
    }

    while let j = s.index(i, offsetBy: 5, limitedBy: s.endIndex) {
        let a = Int(s[i..<j])!
        let b = a % 2019
        if b == 0 { r += 1 }
        s.replaceSubrange(i..<j, with: String(b))
    }

    if s != "0" && Int(s)!.isMultiple(of: 2019) {
        r += 1
    }
}

print(r)


"use strict";
var input=require("fs").readFileSync("/dev/stdin","utf8");
var cin=input.split(/ |\n/),cid=0;
function next(a){return a?cin[cid++]:+cin[cid++];}
function nexts(n,a){return a?cin.slice(cid,cid+=n):cin.slice(cid,cid+=n).map(a=>+a);}
function nextm(h,w,a){var r=[],i=0;if(a)for(;i<h;i++)r.push(cin.slice(cid,cid+=w));else for(;i<h;i++)r.push(cin.slice(cid,cid+=w).map(a=>+a));return r;}
function xArray(v){var a=arguments,l=a.length,r="Array(a["+--l+"]).fill().map(x=>{return "+v+";})";while(--l)r="Array(a["+l+"]).fill().map(x=>"+r+")";return eval(r);}

var myOut = main();
if(myOut !== undefined)console.log(myOut);

function main(){
  var s = next(1);
  var map = xArray(0,2020);
  var x = 0, ans = 0, k = 1;
  map[0] = 1;
  for(var i = s.length; i--;){
    x += +s[i] * k;
    x %= 2019;
    k = k*10%2019;
    ans += map[x]++;
  }
  return ans;
}


//0:実行モード
//1:開発モード
//2:最終テストモード
const sys_debugMode : number = 0;

function chk(in_data1 : any, in_data2? : any) : void{
	if (sys_debugMode == 0 || sys_debugMode == 2){
		return;
	}
	else if (in_data2 === undefined){
		console.log(in_data1);
	}
	else{
		console.log(in_data1 + "[" + typeof(in_data2) + "] =", in_data2);
	}
}

function prt(in_data : any) : void{
	console.log(in_data);
}

class ParamManager {

	private a_s_inputLines : string[];
	private n_maxLine : number;
	private n_nowLineCnt : number;

	constructor(){
		this.a_s_inputLines = this.inputLines();
		this.n_maxLine = this.a_s_inputLines.length;
		this.descLines();
		this.n_nowLineCnt = 1;
	}
	inputLines(){
		const fs = require('fs');

		let text;
		if(sys_debugMode == 0){
			text = fs.readFileSync("/dev/stdin", 'utf8');
		}
		else{
			text = fs.readFileSync("input.txt", 'utf8');
		}

		const line:string[] = text.toString().replace(/\r/g, "").split('\n');

		return line;
	}
	descLines(){
		chk("ParamManager.a_s_inputLines", this.a_s_inputLines);
	}
	getNextLine(in_s_type?):any{
		if (this.n_nowLineCnt > this.n_maxLine){
			chk("ParamManager.getNextLine","No Next Line!");
			return;
		}
		const s_returnLine:string = this.a_s_inputLines[this.n_nowLineCnt - 1];

		this.n_nowLineCnt++;

		if (in_s_type == "n"){
			return parseInt(s_returnLine);
		}
		else if (in_s_type == "a"){
			return s_returnLine.split(" ");
		}
		else if (in_s_type == "an"){
			const a_s_temp = s_returnLine.split(" ");
			const a_n_temp = a_s_temp.map(function(str){return Number(str)});
			return a_n_temp;
		}
		else if(in_s_type == "s"){
			const aMoji:string[] = s_returnLine.split("");
			return aMoji;
		}
		else if(in_s_type == "sn"){
			const aMoji:string[] = s_returnLine.split("");
			const aNum:number[] = aMoji.map(function(str){return Number(str)});
			return aNum;
		}
		else{
			return s_returnLine;
		}
	}
}
const paramManager = new ParamManager();
//==================================================
//https://atcoder.jp/contests/abc164/tasks/abc164_d
//D - Multiple of 2019
//1 から 9 までの数字のみからなる文字列Sが与えられます。
//次のような条件を満たす整数の組(i,j)(1≤i≤j≤|S|) の総数を求めてください。
//条件: Sの i文字目から j文字目までを 10進法の整数としてみると、この整数は 2019の倍数である。
//==================================================
class Param{
	inputLine:string;

	constructor(){
		chk("--------------------------------------------------");
		chk("パラメータ");
		//文字列Sが与えられます。
		//・1 から 9 までの数字のみからなる
		//・1≤|S|≤200000
		this.inputLine = paramManager.getNextLine();

		chk(this);
	}
}
const param = new Param();
//==================================================
class Manager{
	numString:string;
	successCnt:number;

	constructor(){
		this.successCnt = 0;
		this.main();
	}

	main():void{
		chk("--------------------------------------------------");
		chk("main");

		this.makeNumData();
		this.start();
		this.resultOutput();
	}

	start():void{
		chk("--------------------------------------------------");
		chk("start");
		//次のような条件を満たす整数の組(i,j)(1≤i≤j≤|S|) の総数を求めてください。
		//条件: Sの i文字目から j文字目までを 10進法の整数としてみると、この整数は 2019の倍数である。

		//3文字以下はチェック不可
		if(this.numString.length <= 3){
			return;
		}

		//ループ　startPos　1　から　最後-3(2019の文字列数)　まで
		for(let loopStartPos = 1 ; loopStartPos <= this.numString.length - 3 ; loopStartPos++){
			chk("==================================================");
			chk("loopStartPos",loopStartPos);
			//ループ　endPos
			for(let loopEndPos = loopStartPos + 3 ; loopEndPos <= this.numString.length ; loopEndPos++){
				chk("--------------------------------------------------");
				chk("loopEndPos",loopEndPos);

				//切り取り数字
				const kiritoriNum:string = this.numString.slice(loopStartPos-1, loopEndPos);
				chk("kiritoriNum",kiritoriNum);

				//2019倍数チェック
				if(parseInt(kiritoriNum) % 2019 == 0){
					chk("2019の倍数！！！");
					//成功カウントプラス
					this.successCnt++;
				}
			}
		}
	}

	makeNumData():void{
		chk("--------------------------------------------------");
		chk("makeNumData");

		this.numString = param.inputLine;
		chk("this.numString",this.numString);
	}

	resultOutput():void{
		chk("--------------------------------------------------");
		chk("resultOutput");
		//条件を満たす整数の組 (i,j)(1≤i≤j≤|S|) の総数を出力せよ。
		prt(this.successCnt);
	}

}
const manager = new Manager();
//==================================================


import { count } from 'console';

process.stdin.resume();
process.stdin.setEncoding('utf8');

// 標準入力取込
let gInput = '';
process.stdin.on('data', (chunk) => (gInput += chunk));
process.stdin.on('end', () => main(gInput.split(/\r?\n/)));

// 解答
function main(inputs: string[]): void {
  const s = inputs[0];
  const noList = new Set();
  const yesList = new Set();
  let count = 0;
  let left = 0;
  let right = 4;
  let num = Number(s.substring(0, 4));

  while (String(num).length >= 4) {
    if (num % 2019 == 0) {
      count++;
      left = right - 1;
      right += 4;
      num = Number(s.substring(left, right));
      continue;
    }
    right++;
    if (right > s.length) {
      left++;
      right = left + 4;
    }
    num = Number(s.substring(left, right));
  }

  console.log(count);
}


import { count } from 'console';

process.stdin.resume();
process.stdin.setEncoding('utf8');

// 標準入力取込
let gInput = '';
process.stdin.on('data', (chunk) => (gInput += chunk));
process.stdin.on('end', () => main(gInput.split(/\r?\n/)));

// 解答
function main(inputs: string[]): void {
  const s = inputs[0];
  const noList = new Set();
  const yesList = new Set();
  let count = 0;
  let left = 0;
  let right = 4;
  let num = Number(s.substring(0, 4));

  while (String(num).length >= 4) {
    if (num % 2019 == 0) {
      count++;
    }
    right++;
    if (right > s.length) {
      left++;
      right = left + 4;
    }
    num = Number(s.substring(left, right));
  }

  console.log(count);
}


A,B = map(int,input().split())
ans = 0
while 1:
    C = int(ans*0.08)
    D = int(ans*0.1)
    if C == A and D == B:
        print(ans)
        break
    if C > A or D > B:
        print(-1)
        break
    ans += 1


a, b = map(int, input().split())
for i in range(10, 1001):
    if int(i * 0.08) == a and int(i * 0.1) == b:
        print(i)
        exit()
print(-1)


import math
A, B = map(int, input().split())
max_price = math.ceil((A+0.99999)/0.08)
min_price = math.floor((B/0.1))
found = 0
for price in range(min_price, max_price+1):
  if math.floor(price*0.08) == A and math.floor(price*0.1) == B:
    print(price)
    found = 1
    break
if found == 0:
  print(-1)


a,b=map(int,input().split())

ans=-1
n = int(max(12.5*a,10*b))

if int(n*1.1)-b == int(n*1.08)-a:
    ans=n

print(ans)


a,b=map(int,input().split())
x1=a*100//8
x2=b*10
if x1//10==b:
    print(x1)
else:
    print(-1)


a,b=map(int,input().split())
x1=a*100//8
x2=b*10
 if x1//10==b:
    print(x1)
else:
    print(-1)


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

public class Main {

	public static void main(String[] args) {
		FastScanner sc = new FastScanner();
		int A = sc.nextInt();
		int B = sc.nextInt();

		int ans = 1;
		while (ans <= 1250) {
			if ((int) (ans * 0.08) == A && (int) (ans * 0.1) == B) {
				System.out.println(ans);
				return;
			}
			ans++;
		}
		System.out.println(-1);
	}

	//以下、自作ライブラリ

	/*
		int N = sc.nextInt();

		int[] a = new int[N];
		for (int i = 0; i < N; i++)
			a[i] = sc.nextInt();

		String s = sc.next();

		String[] a = new String[N];
		for (int i = 0; i < N; i++)
			a[i] = sc.next();

		int[][] a = new int[N][2];
		for (int i = 0; i < N; i++) {
			a[i][0] = sc.nextInt();
			a[i][1] = sc.nextInt();
		}
		Arrays.sort(a, (x, y) -> Integer.compare(x[0], y[0]));

		List<Integer> list = new ArrayList<>();

		Set<Integer> set = new HashSet<>();

		Map<Integer, Integer> map = new HashMap<>();

		nextLineのときは
		Scanner sc = new Scanner(System.in);
	 */

	//繰り返し二乗法による,べき乗計算で剰余を返す
	public static long modPow(long x, long n, final long mod) {
		long sum = 1;
		while (n > 0) {
			if ((n & 1) == 1) { //ビットが立っていたら
				sum = (sum * x) % mod; //x^2^k1 * x^2^k2 * x^2^k3 * ・・・
			}
			x = (x * x) % mod; //((x^2)^2)^2 ・・・
			n >>= 1;
		}
		return sum;
	}

	//組み合わせの数nCrを計算し剰余を返す
	public static long calcNumOfCombinationMod(long n, int r, final long mod) {
		long num = 1;
		for (int i = 0; i < r; i++) {
			num = (num * (n - i)) % mod;
			num = (num * modPow(i + 1, mod - 2, mod)) % mod;
		}
		return num;

	}

	//組み合わせの数nCrを計算
	public static int calcNumOfCombination(int n, int r) {
		int num = 1;
		for (int i = 1; i <= r; i++) {
			num = num * (n - i + 1) / i;
		}
		return num;
	}

	//階乗
	public static int fact(int n) {
		if (n == 1 || n == 0)
			return 1;
		else
			return n * fact(n - 1);
	}

	//指定した値以上の要素が最初に現れる位置
	//要素の数は+1（配列のズレ)
	public static long lowerBound(int n, long[] x, long y) {
		int left = 0;
		int right = n;
		while (left < right) {
			int mid = (left + right) / 2;
			if (x[mid] < y) {
				left = mid + 1;
			} else {
				right = mid;
			}
		}
		return left;
	}

	//指定した値より大きい要素が最初に現れる位置
	//要素の数は+1（配列のズレ)
	public static long upperBound(int n, long[] x, long y) {
		int left = 0;
		int right = n;
		while (left < right) {
			int mid = (left + right) / 2;
			if (x[mid] <= y) {
				left = mid + 1;
			} else {
				right = mid;
			}
		}
		return left;
	}

	//最大公約数
	public static long gcd(long a, long b) {
		if (a < b)
			return gcd(b, a);
		long c = 0;
		c = a % b;
		if (c == 0)
			return b;
		return gcd(b, c);
	}

	//最小公倍数
	public static long lcm(long m, long n) {
		return m * n / gcd(m, n);
	}

	//素数判定
	public static boolean isPrime(int n) {
		if (n < 2)
			return false;
		if (n == 2)
			return true;
		if (n % 2 == 0)
			return false;

		for (int i = 3; i * i <= n; i += 2) {
			if (n % i == 0)
				return false;
		}
		return true;
	}
}

//以下、高速スキャナークラス
class FastScanner {
	private final InputStream in = System.in;
	private final byte[] buffer = new byte[1024];
	private int ptr = 0;
	private int buflen = 0;

	private boolean hasNextByte() {
		if (ptr < buflen) {
			return true;
		} else {
			ptr = 0;
			try {
				buflen = in.read(buffer);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (buflen <= 0) {
				return false;
			}
		}
		return true;
	}

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

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

	public boolean hasNext() {
		while (hasNextByte() && !isPrintableChar(buffer[ptr]))
			ptr++;
		return hasNextByte();
	}

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

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

	public int nextInt() {
		long nl = nextLong();
		if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)
			throw new NumberFormatException();
		return (int) nl;
	}

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


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

public class Main {
	InputStream is;
	PrintWriter out;
	String INPUT = "";

	void solve() {
		int a = ni(), b = ni();
		for(int i = 1; i <= 10000; i++) {
			if(i * 8 / 100 == a && i * 10 / 100 == b) {
				out.println(i);
				return;
			}
		}
		out.println(-1);
	}

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

	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 static void tr(Object... o) {
		System.out.println(Arrays.deepToString(o));
	}
}


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

public class Main{
    public static void main(String[] args) {
        FastScanner sc = new FastScanner();
        PrintWriter out = new PrintWriter(System.out);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int res = -1;
        for(int i=0;i<=1250;i++){
            if(i*2/25==a&&i/10==b){
                res = i;
                break;
            }
        }

        out.println(res);

        out.flush();
    }

}

class UnionFindTree {
    int[] root;
    int[] rank;
    int[] size;
    public UnionFindTree(int n) {
        this.root = new int[n];
        this.rank = new int[n];
        this.size = new int[n];
        for(int i=0;i<n;i++){
            root[i] = i;
            size[i] = 1;
        }
    }

    public int find(int x){
        if(root[x]==x) return x;
        else{
            return root[x] = find(root[x]);
        }
    }

    public void unite(int x, int y){
        x = find(x);
        y = find(y);
        if(x==y) return;
        if(rank[x] < rank[y]){
            size[find(y)] = size[find(x)];
            root[x] = y;
        }
        else{
            size[find(x)] = size[find(y)];
            root[y] = x;
            if(rank[x]==rank[y]) rank[x]++;
        }
    }

    public boolean same(int x, int y){
        return find(x) == find(y);
    }

    public int size(int i){
        return this.size[find(i)];
    }
}

class nextPermutation{
    public static int[] swap(int data[], int left, int right)
    {

        // Swap the data
        int temp = data[left];
        data[left] = data[right];
        data[right] = temp;

        // Return the updated array
        return data;
    }

    // Function to reverse the sub-array
    // starting from left to the right
    // both inclusive
    public static int[] reverse(int data[], int left, int right)
    {

        // Reverse the sub-array
        while (left < right) {
            int temp = data[left];
            data[left++] = data[right];
            data[right--] = temp;
        }

        // Return the updated array
        return data;
    }

    // Function to find the next permutation
    // of the given integer array
    public static boolean findNextPermutation(int data[])
    {

        // If the given dataset is empty
        // or contains only one element
        // next_permutation is not possible
        if (data.length <= 1)
            return false;

        int last = data.length - 2;

        // find the longest non-increasing suffix
        // and find the pivot
        while (last >= 0) {
            if (data[last] < data[last + 1]) {
                break;
            }
            last--;
        }

        // If there is no increasing pair
        // there is no higher order permutation
        if (last < 0)
            return false;

        int nextGreater = data.length - 1;

        // Find the rightmost successor to the pivot
        for (int i = data.length - 1; i > last; i--) {
            if (data[i] > data[last]) {
                nextGreater = i;
                break;
            }
        }

        // Swap the successor and the pivot
        data = swap(data, nextGreater, last);

        // Reverse the suffix
        data = reverse(data, last + 1, data.length - 1);

        // Return true as the next_permutation is done
        return true;
    }
}

class graph{
    int[][] graph;
    public graph(int[][] graph){
        this.graph = graph;
    }

    public long dijkstra(int s, int t){
        Integer[] dist = new Integer[graph.length];
        int[] prev = new int[graph.length];
        Arrays.fill(prev, -1);
        PriorityQueue<Integer> manage = new PriorityQueue<>((x,y) -> dist[x]-dist[y]);
        HashSet<Integer> searched = new HashSet<>();
        Arrays.fill(dist,Integer.MAX_VALUE);
        dist[s] = 0;
        searched.add(s);
        for(int i=0;i<graph.length;i++){
            if(graph[s][i]!=Integer.MAX_VALUE){
                dist[i] = graph[s][i];
                prev[i] = s;
                manage.add(i);
            }
        }
        while(manage.size()>0){
            int now = manage.poll();
            searched.add(now);
            for(int i=0;i<graph.length;i++){
                if(graph[now][i]!=Integer.MAX_VALUE){
                    if(!searched.contains(i)){
                        if(dist[i]==Integer.MAX_VALUE){
                            dist[i] = dist[now] + graph[now][i];
                            prev[i] = now;
                            manage.add(i);
                        }
                        else{
                            dist[i] = Math.min(dist[i],dist[now]+graph[now][i]);
                            if(dist[i]==dist[now]+graph[now][i]) prev[i] = now;
                            manage.remove(i);
                            manage.add(i);
                        }
                    }
                }
            }
            if(searched.contains(t)) break;
        }

        return dist[t];
    }

    public boolean judgeBipartitegraph(){
        int[] color = new int[graph.length];
        PriorityQueue<Integer> queue = new PriorityQueue<>();
        HashSet<Integer> visited = new HashSet<>();
        queue.add(0);
        color[0] = 1;
        while(queue.size()>0){
            int now = queue.poll();
            visited.add(now);
            for(int j=0;j<graph[now].length;j++){
                if(visited.contains(j)) continue;
                if(graph[now][j]!=0){
                    if(color[j]==color[now]) return false;
                    queue.add(j);
                    if(color[j]==0) color[j] = -1*color[now];
                }
            }
        }
        return true;
    }

    public int[][] prim(){
        int[] mincost = new int[graph.length];
        boolean[] used = new boolean[graph.length];
        int[][] spanning = new int[graph.length][graph.length];
        for(int i=0;i<graph.length;i++){
            mincost[i] = Integer.MAX_VALUE;
            used[i] = false;
        }
        mincost[0] = 0;
        int totalCost = 0;
        while(true){
            int v = -1;
            for(int u=0;u<graph.length;u++){
                if(!used[u] && (v==-1||mincost[u]<mincost[v])){
                    v = u;
                }
            }
            if(v==-1) break;
            used[v] = true;
            totalCost += mincost[v];
            for(int u=0;u<graph.length;u++){
                if(graph[v][u]<mincost[u]){
                    mincost[u] = graph[v][u];
                }
            }
            for(int u=0;u<graph.length;u++){
                if(mincost[u]==graph[v][u]){
                    spanning[v][u] = 1;
                    spanning[u][v] = 1;
                    break;
                }
            }
        }
        return spanning;
        // return totalCost;
    }

    public int[][] wf(){
        int[][] dist = new int[graph.length][graph.length];
        dist = graph.clone();
        // for(int i=0;i<graph.length;i++){
        //     dist[i][i] = 0;
        // }
        for(int k=0;k<graph.length;k++){
            for(int i=0;i<graph.length;i++){
                for(int j=0;j<graph.length;j++){
                    if(dist[i][k]==Integer.MAX_VALUE || dist[k][j]==Integer.MAX_VALUE) continue;

                    dist[i][j] = Math.min(dist[i][j],dist[i][k]+dist[k][j]);

                }
            }
        }
        for(int i=0;i<graph.length;i++){
            if(dist[i][i]<0) return null;
        }
        return dist;
    }
}

@SuppressWarnings("unchecked")
class SegmentTree<T> {
    private BiFunction<T, T, T> f;
    private int n;
    private T d1;
    private T[] dat;
    private  SegmentTree(T[] dat, int n_, BiFunction<T, T, T> f, T d1){
        this.f = f;
        this.d1 = d1;
        init(n_);
        build(dat);
    }

    public SegmentTree(T[] dat, BiFunction<T, T, T> f, T d1){
        this(dat, dat.length, f, d1);
    }

    public SegmentTree(int n_, BiFunction<T, T, T> f, T d1){
        this((T[]) new Object[0], n_, f, d1);
    }

    private void init(int n_){
        n = 1;
        while(n<n_) this.n *= 2;
        this.dat = (T[]) new Object[2 * this.n - 1];
    }

    private void build(T[] v){
        for(int i=0;i<n;i++) dat[i+n-1] = i < v.length ? v[i]: d1;
        for(int i=n-2;i>=0;i--) dat[i] = f.apply(dat[i*2+1], dat[i*2+2]);
    }

    public <E> void update(int k,BiFunction<T,E,T> g, E a){
        k += n-1;
        dat[k] = g.apply(dat[k], a);
        while(k>0){
            k = (k-1)/2;
            dat[k] = f.apply(dat[k*2+1], dat[k*2+2]);
        }
    }

    private T query(int a, int b, int k,int l, int r){
        if(r<=a || b<=l) return d1;
        if(a<=l&&r<=b) return dat[k];
        T vl = query(a, b, k*2+1, l, (l+r)/2);
        T vr = query(a, b, k*2+2, (l+r)/2, r);
        return f.apply(vl, vr);
    }

    public T query(int a, int b){
        return query(a, b, 0, 0, n);
    }
}

class MyMath{
    public static long gcm(long a, long b){

        if(a<b) return gcm(b, a);

        if(a%b==0 || b==0) return b;

        long remainder = a%b;
        return gcm(b, remainder);
    }

    public static long summation(long a, long b){
        return b*(b+1)/2-a*(a-1)/2;
    }

    public static long factorial(long n){

        if(n<=1) return 1;
        else return factorial(n-1)*n;
    }

    public static long binomial(int a, int b){
        if(a<b) return 0;
        long[][] table = new long[a+1][a+1];
        for(int i=0;i<a+1;i++){
            table[0][a] =  0;
            table[i][0] = 1;
            table[i][i] = 1;
        }
        for(int i=1;i<a+1;i++){
            for(int j=1;j<a+1;j++){
                if(i<j) table[i][j] = 0;
                else{
                    table[i][j] = table[i-1][j-1] + table[i-1][j];
                }
            }
        }
        return table[a][b];
    }

    public static long repeatSquarePow(int a, int n, int p){
        if(n==0) return 1;
        if(n==1) return a % p;
        if(n%2==1) return a * repeatSquarePow(a,n-1,p) % p;
        long tmp = repeatSquarePow(a, n/2, p) % p;
        return tmp*tmp % p;
    }

    public static long modinv(long a, long p){
        long b, x, u, q, abs_p, tmp;
        abs_p = Math.abs(p);
        b = p;
        x = 1;
        u = 0;
        while(b > 0){
            q = a / b;
            tmp = u;
            u = x - q*u;
            x = tmp;
            tmp = b;
            b = a - q*b;
            a = tmp;
        }
        return(x < 0) ? abs_p + x: x;
    }
}

class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        }else{
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
    private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
    private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
    public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}
    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    public long nextLong() {
        if (!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while(true){
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
        return (int) nl;
    }
    public double nextDouble() { return Double.parseDouble(next());}
}

class BinaryIndexedTree{
    int[] data;
    int[] tree;
    int n;

    public BinaryIndexedTree(int[] data){
        this.data = data;
        this.n = data.length;
        this.tree = new int[n+1];
        buildTree();
    }

    public void buildTree(){
        for(int i=0;i<n;i++){
            add(i+1, data[i]);
        }
    }

    public void add(int index, int value){
        for(int i=index; i<=n; i+=i & -i){
            tree[i] += value;
        }
    }

    public int sum(int from, int to){
        return sum(to) - sum(from-1);
    }

    public int sum(int index){
        int sum = 0;
        for(int i=index; i>0; i-=i & -i){
            sum += tree[i];
        }
        return sum;
    }
}


import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();

		for (int ans = Math.min(a * 7, b * 9); ans < Math.max(a * 13, b * 11); ans++) {
			if ((int)(ans * 0.08) == a && (int)(ans * 0.1) == b) {
				System.out.println(ans);
				return;
			}
		}
		System.out.println(-1);

	}

}


import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        double tax_8 = sc.nextDouble();
		double tax_10 = sc.nextDouble();
		boolean lowTax8 = false;
		if(tax_8 * 2 < tax_10) {
			System.out.println("-1");
			System.exit(0);
		}
		if(tax_8 * 12.5 < tax_10 * 10)
		lowTax8 = true;
        if(lowTax8 && tax_8 * 12.5 / 10 <= (int)tax_10) {
			System.out.println((int)(tax_8 * 12.5));
		}else if(lowTax8){
			System.out.println((int)(tax_10 * 10));
		}
		if(!lowTax8 && tax_10 * 10 / 8 <= (int)tax_8) {
			System.out.println((int)(tax_10 * 10));
		}else if(!lowTax8){
			System.out.println((int)(tax_8 * 12.5));
		}
	}
}


import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int A = scan.nextInt();
		int B = scan.nextInt();
		int f = 0;

		for (int price = B*10; price < (B+1)*10; price++) {
			if ((int)((double)price*0.08 + 0.05) == A) {
				System.out.println(price);
				f++;
				break;
			}
		}

		if (f == 0) {
			System.out.println(-1);
		}

	}

}


//
//  main.cpp
//  At
//
//  Created by 熊本和正 on 2020/03/07.
//  Copyright © 2020 kumamotone. All rights reserved.
//

#define ALL(obj) (obj).begin(), (obj).end()

#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <bitset>
#include <algorithm>
#include <complex>
#include <array>
#include <functional>

using namespace std;
typedef long long ll;
const ll INF = 1e18;

ll A, B;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cin >> A >> B;

    ll a = ceil(A * 12.5);
    ll adash = ceil((A+1)*12.5);
    ll b = B * 10;
    ll bdash = (B+1) * 10;

    if (a==b) {
        cout << b << endl;
    } else if(a>b) {
        if (bdash > a) {
            cout << a << endl;
        } else {
            cout << "-1" << endl;
        }
    } else if(a<b) {
        if (b < adash) {
            cout << b << endl;
        } else {
            cout << "-1" << endl;
        }
    }
    return 0;
}


#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
ll MOD = 1e9+7;

#define vec vector<int>
#define vecll vector<ll>
#define vpair vector<pair<int, int>>
#define vpairll vector<pair<ll, ll>>

#define rep(i,n)         for(int i=(int)0; i<(int)n; i++)
#define REP(i,m,n)       for(int i=(int)m; i<(int)n; i++)
#define arr(var, n)      vec var(n); rep(i,n){cin >> var[i];}
#define arrll(var, n)    vecll var(n); rep(i,n){cin >> var[i];}
#define all(var)         (var).begin(), (var).end()
#define sortall(var)     sort(all(var))
#define prt(var)         cout << var << endl
#define prtd(n, var)     cout << fixed << setprecision(n) << var << endl
#define prt2(v1, v2)     cout << v1 << " " << v2 << endl
#define prt3(v1, v2, v3) cout << v1 << " " << v2 << " " << v3 << endl
#define prtall(var)      rep(i,var.size()){cout << var[i] << " ";} cout << endl

//----------------------------------------------------------------

int main(void) {
  int a, b;
  cin >> a >> b;

  double a_min, a_max, b_min, b_max;
  a_min = a/0.08;
  a_max = (a+1)/0.08;
  b_min = b/0.1;
  b_max = (b+1)/0.1;

  rep(i,1300){
    if(i>=a_min && i<a_max && i>=b_min && i<b_max){
      prt(i); return 0;
    }
  }

  prt(-1);
}


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

#define rep2(i,a,b) for(int i = (a); i < (b); ++i)
#define rep(i,n) rep2(i,0,n)
#define all(a) a.begin(),a.end()
using ll = long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vvvi = vector<vector<vector<int>>>;
using mii = map<int, int>;
using msi = map<string, int>;
using pii = pair<int, int>;

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << std::fixed << std::setprecision(15);

    int a, b;
    cin >> a >> b;
    rep(i, 100001) {
        if(i * 8 / 100 == a && i / 10 == b) {
            cout << i << endl;
            return 0;
        }
    }
    cout << -1 << endl;

    return 0;
}


#include <iostream>
#include <vector>
#include<algorithm>
#include<string>
#include<stdio.h>
#include<map>
#include<math.h>
#include<queue>
using namespace std;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
const int MOD = 1000000007;
const int mod = 1000000007;
const int INF = 1000000000;
const long long LINF = 1e18;
const int MAX = 510000;

int main(){
	int a, b;
	int ans=-1;
	cin >> a >> b;
	for (int i = 0; i < 10000000; i++) {
		if (i * 0.08 == a && i * 0.1 == b) {
			ans = i; break;
		}
	}
	cout << ans << endl;
}


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

#define REP(i,n) for(int i=0;i<(n);++i)
#define ll long long
const long long INF = 1LL<<60;
const long long mod = 100000007;
using Graph = vector<vector<int>>;

int main(){
    int A,B;
    cin >> A >> B;
    A*=25;
    A/=2;
    if(A/10==B) cout << A << endl;
    else cout << -1 << endl;
}


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

int main(){
    int a, b;
    cin >> a >> b;
    int num1 = a/0.08, num2 = b/0.1;
    int maxnum = max(num1, num2);
    int ans = maxnum;
    bool ok = false;
    if(abs(num1-num2) < 10){
        for(int i=1; i<=maxnum; i++){
            int ad = i*0.08, bd=i*0.1;
            if(ad==bd && ad>0 && bd>0){
                ans = i;
                ok = true;
            }
        }
    }
    if(num1 == num2){
        ok = true;
        ans = num1;
    }
    if(ok) cout << ans << endl;
    else cout << -1 << endl;
    return 0;
}


#include<stdio.h>
int main(void)
{
  int a,b;
  scanf("%d %d",&a,&b);
  for(int i=a;i<=1010;i++){
    if((i*8)/100==a&&(i*10)/100==b){
      printf("%d\n",i);
      return 0;
    }
  }

  puts("-1");
  return 0;
}


#include <stdio.h>

int main(){
	int a,b;
	scanf("%d%d",&a,&b);
	for(int i=1;i<10000;i++){
		if(i*8/100==a&&i*10/100==b){
			printf("%d",i);
			return 0;
		}
	}
	puts("-1");
}


#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
int main(void){
    int a,b,i,ans;
    scanf("%d %d",&a,&b);
    for(i=1; i<11000; i++){
        if(i*2/25==a && i/10==b){
            printf("%d",i);
            return 0;
        }
    }
    printf("-1");
    return 0;
}


#include <stdio.h>

int main(void){
  int a,b,i;
  scanf("%d %d",&a,&b);
  for(i=1;i<=2000;i++){
    if((0.08*i==a)&&(0.1*i==b)) break;
    if(i==2000) i=-1;
  }
  printf("%d\n",i);

  return 0;
}


#include <stdio.h>

int main(void){

    int a, b, i, a1, a2;

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

    for(i=1;i<=1000;i++){

        a1 = i * 8 / 100;
        a2 = i * 10 / 100;

        if(a1 == a && a2 == b){
            printf("%d",i);
            return 0;
        }
    }

    printf("-1");
    return -1;
}


'use strict'

function main(inp) {
  inp = inp.trim().split(' ')
  const A = Number(inp[0])
  const B = Number(inp[1])

  const t8 = Math.ceil(A / 0.08)
  const t10 = Math.ceil(B / 0.1)

  for (let i = Math.min(t8, t10); i <= Math.max(t8, t10); i++) {
    if (Math.floor(i * 0.08) === A && Math.floor(i * 0.1) === B) {
      return console.log(i)
    }
  }
  console.log(-1)
}

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


function Main(input){
	var A = parseInt(input.trim().split(" ")[0],10);
  	var B = parseInt(input.trim().split(" ")[1],10);
  	var min = 0;
 	var MAX = 1000;
  	var res = [];
  	for(var i = 1;i<=MAX;i++){
      	var x1 = Math.floor(i*0.08);
      	var x2 = Math.floor(i*0.1);
    	if(x1 == A && x2 == B)res.push(i);
    }
  	if(res.length == 0){
    	console.log(-1);
    }else{
    	console.log(Math.min(...res));
    }
}
Main(require("fs").readFileSync("/dev/stdin","utf8"));


function Main(input) {
  "use strict"
  const temp = input.split("\n")[0].split(" ");

  const a = parseInt(temp.shift());
  const b = parseInt(temp.shift());

  const a_min = Math.ceil(a * 12.5)
  const a_max = Math.ceil(a * 12.5 + 11.5)
  const b_min = Math.ceil(b * 10)
  const b_max = Math.ceil(b * 10 + 9)

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


const input = require("fs").readFileSync("/dev/stdin", "utf8")
const lines = input.split('\n')
const [A, B] = lines[0].split(' ').map(Number)

const a = A / 0.08
const b = B / 0.1

let ans = null
if (a < b && Math.floor(b * 0.08) === A) {
    ans = b
} else if (a > b && Math.floor(a * 0.1) === B) {
    ans = a
} else if (a === b) {
    ans = a
} else {
    ans = -1
}
console.log(ans)


function *main() {

  const [A, B] = (yield).split(" ").map(s => +s);

  // floor(X/25) = A/2 => A*25/2 <= X <= A*25/2+24
  // floor(X/10) = A => A*10 <= X <= A*10+9
  const l1 = (A%2) ? Math.floor(A/2)*25+13 : Math.floor(A/2)*25, r1 = l1+24;
  const l2 = 10*B, r2 = l2+9;

  if (r1 < l2 || r2 < l1) {
    console.log(-1);
  } else {
    console.log(Math.max(l1, l2));
  }

}

const iter = main();
iter.next();
require("readline").createInterface({input: process.stdin}).on("line", s => iter.next(s));


function *main() {

  const [A, B] = (yield).split(" ").map(s => +s);

  // floor(X/25) = A/2 => A*25/2 <= X <= A*25/2+24
  // floor(X/10) = A => A*10 <= X <= A*10+9
  const l1 = Math.ceil(12.5*A), r1 = l1+24;
  const l2 = Math.ceil(10*B), r2 = l2+9;

  if (r1 < l2 || r2 < l1) {
    console.log(-1);
  } else {
    console.log(Math.max(l1, l2));
  }

}

const iter = main();
iter.next();
require("readline").createInterface({input: process.stdin}).on("line", s => iter.next(s));


package main

import "fmt"

func main() {
	var a, b int
	fmt.Scan(&a, &b)
	result := -1
	for i:=1; i<=1009; i++{
		if int(float64(i) * 0.08) == a && int(float64(i) * 0.1) == b{
			result = i
			break
		}
	}

	fmt.Println(result)
}


package main

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

const mod = 1000000007

// 1MB
const ioBufferSize = 1 * 1024 * 1024

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

func next() 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 main() {
	a, b := nextInt(), nextInt()

	for x := 1; x < 1500; x++ {
		if int(float64(x)*0.08) == a && int(float64(x)*0.1) == b {
			fmt.Println(x)
			return
		}
	}
	fmt.Println(-1)
}


package main

import (
	"fmt"
)

// go run ./main.go < in

type NibunData struct {
	target int
	left   int
	mid    int
	right  int
}

var nubunData NibunData

var a, b int

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

	num8 := 0
	var stack []int
	for i := 0; i < 1265; i++ {
		num8 = about8(i)
		if num8 != 0 {
			stack = append(stack, num8)
		}
	}

	num10 := 0
	for _, v := range stack {
		num10 = about10(v)
		if num10 != 0 {
			break
		}
	}

	if num10 == 0 {
		fmt.Println("-1")
	} else {
		fmt.Println(num10)
	}
}

func about8(price int) int {
	if price*8 >= a*100 && price*8 < (a+1)*100 {
		return price
	}
	return 0
}

func about10(price int) int {
	if price*10 >= b*100 && price*10 < (b+1)*100 {
		return price
	}
	return 0
}


package main

import (
	"fmt"
	"math"
)

func main() {
	// Code for C - Tax Increase
	var A, B float64
	fmt.Scanf("%f %f", &A, &B)

	var flag int
	for i := 0; i < 1000; i++ {
		if math.Floor(float64(i)*0.08) == A && math.Floor(float64(i)*0.1) == B {
			fmt.Println(i)
			flag = 1
			break
		}
	}

	if flag == 0 {
		fmt.Println("-1")
	}
}


package main

import "fmt"

func main() {
	var A, B int
	fmt.Scan(&A, &B)
	min := Max((100*A+7)/8, (100*B+9)/10)
	max := Min((100*A+100)/8, (100*B+100)/10)
	if min <= max {
		fmt.Println(min)
	} else {
		fmt.Println(-1)
	}
}

func Min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func Max(a, b int) int {
	if a < b {
		return b
	}
	return a
}


package main

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

func main() {
	io := NewIo(os.Stdin, os.Stdout)
	defer io.Flush()
	a, b := io.NextInt(), io.NextInt()
	max := 100
	lb := sort.Search(max+1, func(i int) bool { return i*8/100 >= a })
	ub := sort.Search(max+1, func(i int) bool { return i*8/100 > a })
	for i := lb; i < ub; i++ {
		if i*10/100 == b {
			io.Println(i)
			return
		}
	}
	io.Println(-1)
}

// Io is I/O object
type Io struct {
	reader    *bufio.Reader
	writer    *bufio.Writer
	tokens    []string
	nextToken int
}

// NewIo returns a new Io instance
func NewIo(r io.Reader, w io.Writer) *Io {
	return &Io{
		reader: bufio.NewReader(r),
		writer: bufio.NewWriter(w),
	}
}

// Flush flushes writer
func (io *Io) Flush() {
	err := io.writer.Flush()
	if err != nil {
		panic(err)
	}
}

// NextLine scans a line from stdin
func (io *Io) NextLine() string {
	var buffer []byte
	for {
		line, isPrefix, err := io.reader.ReadLine()
		if err != nil {
			panic(err)
		}
		buffer = append(buffer, line...)
		if !isPrefix {
			break
		}
	}
	return string(buffer)
}

// Next return a word from stdin
func (io *Io) Next() string {
	for io.nextToken >= len(io.tokens) {
		line := io.NextLine()
		io.tokens = strings.Fields(line)
		io.nextToken = 0
	}
	r := io.tokens[io.nextToken]
	io.nextToken++
	return r
}

// NextInt returns an integer from stdin
func (io *Io) NextInt() int {
	i, err := strconv.Atoi(io.Next())
	if err != nil {
		panic(err)
	}
	return i
}

// Println is a wrapper of fmt.Fprintln
func (io *Io) Println(a ...interface{}) {
	fmt.Fprintln(io.writer, a...)
}


a,b = gets.split(' ').map(&:to_i)
ans = -1
(0..1009).each do |i|
    if (i*0.08).floor == a && (i*0.1).floor == b
        ans = i
        puts ans
        exit
    end
end
puts ans


# n = gets.split.map(&:to_i)
# array = readlines.map(&:chomp!).map { |e| e.split.map(&:to_i) }
#
#

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

res = -1
1000.times do |i|
  if (0.08*(i+1)).floor == a && (0.1*(i+1)).floor == b
    res = i+1
    break;
  end
end

puts res


a, b = gets.split.map(&:to_i)
a1 = (a * 12.5).ceil.to_i
a2 = ((a + 1) * 12.5).to_i
b1 = b * 10
b2 = (b + 1) * 10
r = -1
(a1...a2).each do |i|
  if (b1...b2).include?(i)
    r = i
    break
  end
end
puts r


eval"p (1..1e5).find{_1*2/25==%d&&_2/10==%d}||-1"%gets.split


a,b = gets.chomp.split(' ').map(&:to_i)
a_l = (a / 0.08).to_r
a_r = ((a + 1) / 0.08).to_r
b_l = (b / 0.1).to_r
b_r = ((b + 1) / 0.1).to_r
if a_r.round - a_r == 0
  a_r -= 0.1
end
if b_r.round - b_r == 0
  b_r -= (1/10).to_r
end
ans = ((a_l.ceil..a_r.round).to_a & (b_l.ceil..b_r.round).to_a).min
if ans
  puts ans
else
  puts -1
end


a,b = gets.chomp.split(' ').map(&:to_i)
a_l = a / 0.08
a_r = (a + 1) / 0.08
b_l = b / 0.1
b_r = (b + 1) / 0.1
if a_r.round - a_r == 0
  a_r -= 0.1
end
if b_r.round - b_r == 0
  b_r -= 0.1
end
ans = ((a_l.ceil..a_r.round).to_a & (b_l.ceil..b_r.round).to_a).min
if ans
  puts ans
else
  puts -1
end


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

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

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

fn main() {
    input! {
        a: u32,
        b: u32
    }
    for x in 1..1001 {
        if x *  8 / 100 == a &&
           x * 10 / 100 == b {
            println!("{}", x);
            return;
        }
    }
    println!("-1");
}
/* vim:set foldmethod=marker: */


#![allow(unused_imports)]

use std::cmp::{max, min, Ordering};
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};
use std::io::stdin;
use std::ops::*;
use std::process::exit;
use std::str::FromStr;

fn main() {
    let (a, b): (f64, f64) = input_two();
    for i in 1..10005 {
        if (i as f64 * 0.08).floor() == a && (i as f64 * 0.10).floor() == b {
            println!("{}", i);
            break;
        }
        if i == 10004 {
            println!("-1");
        }
    }

}

pub fn input<T: FromStr>() -> T {
    let mut buf = String::new();
    stdin().read_line(&mut buf).unwrap();
    buf.trim().parse().ok().unwrap()
}

pub fn input_vec<T: FromStr>() -> Vec<T> {
    let mut buf = String::new();
    stdin().read_line(&mut buf).unwrap();
    buf.trim()
        .split_whitespace()
        .map(|x| x.parse().ok().unwrap())
        .collect::<Vec<_>>()
}

pub fn input_lines<T: FromStr>(l: usize) -> Vec<T> {
    let mut res = Vec::new();
    for _i in 0..l {
        res.push(input());
    }
    res
}

pub fn input_lines_two<T: FromStr, U: FromStr>(l: usize) -> Vec<(T, U)> {
    let mut res = Vec::new();
    for _i in 0..l {
        res.push(input_two());
    }
    res
}

pub fn input_lines_three<T: FromStr, U: FromStr, V: FromStr>(l: usize) -> Vec<(T, U, V)> {
    let mut res = Vec::new();
    for _i in 0..l {
        res.push(input_three());
    }
    res
}

pub fn input_two<T: FromStr, U: FromStr>() -> (T, U) {
    let mut buf = String::new();
    stdin().read_line(&mut buf).unwrap();
    let s: Vec<&str> = buf.split_whitespace().collect();
    (
        s[0].parse::<T>().ok().unwrap(),
        s[1].parse::<U>().ok().unwrap(),
    )
}

pub fn input_three<T: FromStr, U: FromStr, V: FromStr>() -> (T, U, V) {
    let mut buf = String::new();
    stdin().read_line(&mut buf).unwrap();
    let s: Vec<&str> = buf.split_whitespace().collect();
    (
        s[0].parse::<T>().ok().unwrap(),
        s[1].parse::<U>().ok().unwrap(),
        s[2].parse::<V>().ok().unwrap(),
    )
}

pub fn input_four<T: FromStr, U: FromStr, V: FromStr, W: FromStr>() -> (T, U, V, W) {
    let mut buf = String::new();
    stdin().read_line(&mut buf).unwrap();
    let s: Vec<&str> = buf.split_whitespace().collect();
    (
        s[0].parse().ok().unwrap(),
        s[1].parse().ok().unwrap(),
        s[2].parse().ok().unwrap(),
        s[3].parse().ok().unwrap(),
    )
}


#[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)
    fact(n) * mod_pow(fact(r), MOD_P - 2) % MOD_P * mod_pow(fact(n - r), MOD_P - 2) % MOD_P
}

#[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;
}

use std::cmp::{max, min};

fn main() {
    input! {
        a:usize,
        b:usize,
    }
    for i in 0..20000 {
        if i * 8 / 100 == a && i / 10 == b {
            println!("{}", i);
            return;
        }
    }
    println!("-1");
}


use std::process::exit;

fn main() {
  let input: Vec<u32> = read_vec();
  for i in 1..101 {
    if i*8/100 == input[0] && i*10/100  == input[1] {
      println!("{}", i);
      exit(0);
    }
  }
  println!("-1");
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
  let mut s = String::new();
  std::io::stdin().read_line(&mut s).ok();
  s.trim().split_whitespace().map(|e| e.parse().ok().unwrap()).collect()
}


use whiteread::parse_line;

fn main() {
    let (a, b): (f64, f64) = parse_line().unwrap();
    let p1 = a / 0.08;
    let p2 = b / 0.1;

    let mut p = p1.min(p2).floor();
    while (p * 0.08).floor() == a || (p * 0.1).floor() == b {
        if (p * 0.08).floor() == a && (p * 0.1).floor() == b {
            println!("{}", p.round() as u32);
            return;
        }
        p += 1.0;
    }
    println!("-1");
}


#[allow(unused_imports)]
use std::{cmp::Reverse, collections::*};

#[allow(unused_imports)]
use proconio::{
    fastout, input,
    marker::{Chars, Usize1},
};

#[allow(unused_imports)]
use itertools::Itertools;

#[allow(unused_imports)]
use num::Integer;

#[fastout]
pub fn main() {
    input! {
        a: i32, b: i32,
    }

    let min = (b as f64 / 0.10).floor() as i32;
    let max = (a as f64 / 0.08).ceil() as i32;

    if min > max {
        println!("-1");
    } else {
        for i in min..=max {
            if (i as f64 * 0.08) as i32 == a && (i as f64 * 0.10) as i32 == b {
                println!("{}", i);
                return;
            }
        }
        println!("-1");
    }
}


let l = readLine()!.split(separator:" ").map{Int($0)!}
var ans:Int?
for x in 10*l[1]..<10*(l[1]+1) {
  if x*2/25 == l[0] {
    ans = x
    break
  }
}
print(ans ?? -1)


import Foundation

func readInts() -> [Int] {
    readLine()!.split(separator: " ").map { Int($0)! }
}

func main() {
    let ab = readInts()
    let (a,b) = (ab[0],ab[1])
    var cost = a * 10

    for _ in cost...10000 {
        if cost * 8 / 100 == a && cost * 10 / 100 == b {
            print(cost)
            return
        }
        cost += 1
    }
    print(-1)
}
main()


import Foundation

func readInts() -> [Int] {
    readLine()!.split(separator: " ").map { Int($0)! }
}

func main() {
    let ab = [68, 85]//readInts()
    let (a,b) = (ab[0],ab[1])
    var cost = a * 10

    for _ in cost...10000 {
        if cost * 8 / 100 == a && cost * 10 / 100 == b {
            print(cost)
            return
        }
        cost += 1
    }
    print(-1)
}
main()


import Foundation

func readInts() -> [Int] {
    readLine()!.split(separator: " ").map { Int($0)! }
}

func main() {
    let ab = readInts()
    let (a,b) = (ab[0],ab[1])
    var cost = a * 10

    for _ in 0...100 {
        if cost * 8 / 100 == a && cost * 10 / 100 == b {
            print(cost)
            return
        }
        cost += 1
    }
    print(-1)
}
main()


import Foundation

func readInts() -> [Int] {
    readLine()!.split(separator: " ").map { Int($0)! }
}

func main() {
    let ab = readInts()
    let (a,b) = (ab[0],ab[1])
    var cost = a * 10

    for _ in 0...100 {
        print(cost, cost * 8 / 100, cost * 10 / 100)
        if cost * 8 / 100 == a && cost * 10 / 100 == b {
            print(cost)
            return
        }
        cost += 1
    }
    print(-1)
}
main()


function main(input) {
  const inputs =input.split('\n')
  const [A, B] = inputs[0].split(' ').map(Number)
  for(let i = 1; i <= 1000; i++) {
    if (Math.floor(i * 0.08) === A && Math.floor(i * 0.1) === B) {
      console.log(i)
      return
    }
  }
  console.log('-1')
}

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


export class Main {
  static main(input: string): string {
    const tmp: string[] = input.split("\n");
    const [a, b]: number[] = tmp.shift().split(" ").map(int => parseInt(int));
    const aY = Math.ceil(a / 0.08);
    const bY = Math.ceil(b / 0.1);
    const aU = Math.ceil((a + 1) / 0.08) - 1;
    const bU = Math.ceil((b + 1) / 0.1) - 1;
    return `${bU < aY || aU < bY ? -1 : Math.max(aY, bY)}`;
  }
}
console.log(Main.main(require("fs").readFileSync("/dev/stdin", "utf8")));


import * as fs from "fs";

const input = (fs.readFileSync("/dev/stdin", "utf8") as string).split("\n");
const [a, b] = input[0].split(" ").map((x: string): number => +x);

const lb = Math.floor(Math.min(a / 0.08, b / 0.1)) - 1;
const ub = Math.floor(Math.max(a / 0.08, b / 0.1)) + 1;

let result = -1;
for (let i = lb; i <= ub; i++) {
	if (Math.floor(i * 0.08) === a && Math.floor(i * 0.1) === b) {
		result = i;
		break;
	}
}

console.log(result);


import * as fs from 'fs';
// main
function main(input: string[]) {
    // param
    let a: number = 0;
    let b: number = 0;
    let ans: number = 0;
    // init
    [a, b] = input.shift().split(" ").map(x => Number(x));
    // solve
    ans = -1;
    for (var rx = 0; rx <= 100; rx++) {
        if (a == Math.floor(rx * 0.08) &&
            b == Math.floor(rx * 0.10)) {
            ans = rx;
            break;
        }
    }
    // answer
    console.log(ans);
}
// entrypoint
function entrypoint() {
    try {
        // linux
        let input = fs.readFileSync("/dev/stdin", "utf8").trim().split("\n");
        console.debug = function () { };
        main(input);
    }
    catch (ex) {
        // windows
        const lines: string[] = [];
        // @ts-ignore
        const reader = require('readline').createInterface({
            // @ts-ignore
            input: process.stdin,
            // @ts-ignore
            output: process.stdout
        });
        reader.on('line', function (line: string) {
            lines.push(line);
        });
        reader.on('close', function () {
            let input = lines;
            main(input);
        });
    }
}
entrypoint();


const main = (input: string) => {
  const [A, B] = input.trim().split(" ").map(str => parseInt(str))
  const taxRateA = 0.08
  const taxRateB = 0.1
  const maxCount = 1010
  let count = 1;
  let answer = -1;

  const taxRateCalc = (n: number) => {
    if(Math.floor(n * taxRateA) === A && Math.floor(n * taxRateB) === B) {
      return n
    } else {
      return -1
    }
  }

  while(answer === -1 || count < maxCount) {
    answer = taxRateCalc(count)
    count += 1
  }
  console.log(answer)
}

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


const main = (input: string) => {
  const [A, B] = input.trim().split(" ").map(str => parseInt(str))
  const taxRateA = 0.08
  const taxRateB = 0.1
  let count = 1;
  let answer = -1;

  const taxRateCalc = (n: number) => {
    if(Math.floor(n * taxRateA) === A && Math.floor(n * taxRateB) === B) {
      return n
    } else {
      return -1
    }
  }

  while(count <= 100 && answer === -1) {
    answer = taxRateCalc(count)
    count += 1
  }
  console.log(answer)
}

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


n = int(input())
h = list(map(int, input().split()))

ans = 1

for i in range(1,len(h)):
  flag = 0
  for j in range(i):
    if h[i] < h[j]:
      flag = 1
  if flag == 0:
    ans += 1

print(ans)


n = int(input())
h = list(map(int, input().split()))

sum = 1

for i in range(1, n):
    flg = True
    for j in range(0, i):
        if h[i] < h[j]:
            flg = False
            break
    if flg:
        sum += 1

print(sum)


c = int(input())
H = input().split()

count = 1
for i in range(c-1):
  v = True
  for j in range(i+1):
    if int(H[i+1]) < int(H[j]):
      v = False
      break
  if v:
    count += 1
print(count)


N = int(input())
N_List = list(map(int,input().split()))
ans = 1
maxN = N_List[0]
for i in range(1,N):
    if N_List[i]>=maxN:
        ans += 1
    else:
        maxN = N_List[i]
print(ans)


import math

def main():
    n = int(input())
    # a, b = map(int, input().split())
    h = list(map(int, input().split()))
    # s = input()
    # h = [int(input()) for _ in rane(n)]

    count = 1
    maxi = h[0]
    for i in range(1, n):
        if h[i] > h[i-1] and h[i] >= maxi:
            count += 1
            maxi = h[i]
    print(count)

if __name__ == '__main__':
    main()


n=int(input())
h=list(map(int,input().split()))
kei = 1
m=0
for i in range(1,n):
    m = h[0]
    if m < h[i]:
        m = h[i]
    else:
        kei += 1

print(kei)


import java.io.DataInputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.util.Arrays;

public class Main {

	public static void main(String[] args) throws Exception {
		int N = in.i();
		int[] H = new int[N + 1];
		int cnt = 0;
		loop: for (int i = 1; i <= N; i++) {
			H[i] = in.i();

			for (int j = 1; j < i; j++)
				if (H[j] > H[i])
					continue loop;

			cnt++;
		}

		out.println(cnt);
	}

	static PrintStream out = System.out;
	static FastReader in = new FastReader();
}

class FastReader {
	final private int BUF_SIZE = 1 << 16;
	private DataInputStream din;
	private byte[] buffer = new byte[BUF_SIZE];
	private int bufferPointer, bytesRead;

	FastReader() {
		din = new DataInputStream(System.in);
	}

	String s() throws IOException {
		byte[] buf = new byte[64];
		int cnt = 0, c;
		while ((c = read()) != -1) {
			if (c == '\n') break;
			buf[cnt++] = (byte) c;
		}
		return new String(buf, 0, cnt);
	}

	int i() throws IOException {
		int ret = 0;
		byte c = read();
		while (c <= ' ') c = read();
		boolean neg = (c == '-');
		if (neg) c = read();
		do {
			ret = ret * 10 + c - '0';
		}
		while ((c = read()) >= '0' && c <= '9');
		return neg ? -ret : ret;
	}

	long l() throws IOException {
		long ret = 0;
		byte c = read();
		while (c <= ' ') c = read();
		boolean neg = (c == '-');
		if (neg) c = read();
		do {
			ret = ret * 10 + c - '0';
		}
		while ((c = read()) >= '0' && c <= '9');
		return neg ? -ret : ret;
	}

	double d() throws IOException {
		double ret = 0, div = 1;
		byte c = read();
		while (c <= ' ') c = read();
		boolean neg = (c == '-');
		if (neg) c = read();
		do {
			ret = ret * 10 + c - '0';
		}
		while ((c = read()) >= '0' && c <= '9');
		if (c == '.')
			while ((c = read()) >= '0' && c <= '9')
				ret += (c - '0') / (div *= 10);
		return neg ? -ret : ret;
	}

	private void fillBuffer() throws IOException {
		bytesRead = din.read(buffer, bufferPointer = 0, BUF_SIZE);
		if (bytesRead == -1) buffer[0] = -1;
	}

	private byte read() throws IOException {
		if (bufferPointer == bytesRead) fillBuffer();
		return buffer[bufferPointer++];
	}

	void close() throws IOException {
		if (din != null) din.close();
	}
}


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

public class Main  {
    public static void main(String[] args) throws IOException {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(input.readLine());
        int count = 1;
        StringTokenizer tokenizer = new StringTokenizer(input.readLine());
        int max = Integer.parseInt(tokenizer.nextToken());
        int value;
        for (int i = 1; i < n; i++) {
            value = Integer.parseInt(tokenizer.nextToken());
            if (value >= max)
                count++;

            max = Math.max(max, value);
        }
        System.out.println(count);
    }
}


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

public class Main {
	public static void main(String[] args) {
		FastScanner sc = new FastScanner();
		int N = sc.nextInt();
		int max = 0;
		int ans = 0;
		for (int i = 0; i < N; i++) {
			int H = sc.nextInt();
			if (H >= max) {
				max = H;
				ans++;
			}
		}
		System.out.println(ans);
	}
}

class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;

    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        } else {
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }

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

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

    public boolean hasNext() {
        while (hasNextByte() && !isPrintableChar(buffer[ptr]))
            ptr++;
        return hasNextByte();
    }

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

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

    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)
            throw new NumberFormatException();
        return (int) nl;
    }

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


import java.util.*;

public class Main {
	public static void main(String[] args) throws Exception{
		Scanner scn = new Scanner(System.in);
		int n = scn.nextInt();
		int[] a = new int[n];
		for(int i=n-1; i>=0; i--){
			a[i] = scn.nextInt();
		}
      	int count = 1;
      	for(int i=1; i<n; i++){
          if(a[i]>=a[i-1]){
            count++;
          }else break;
        }
      	System.out.println(count);
	}
}


import java.util.Scanner;

public class main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
Scanner SC = new Scanner(System.in);
int N = SC.nextInt();
int H [] = new int[N + 1];
for(int i = 0; i < N; i++) {
    H[i] = SC.nextInt();
}
int counter = 0;
for(int i = 0; i <= N; i++) {
	boolean cso = true;
	for(int j = 0; j <= N; i++) {
		if(H[j] > H[i]) {
			cso = false;
		}
	}
	if(cso) {
		counter++;
	}
}
System.out.println(counter);
	}

}


import java.util.Scanner;
public class Main{
  	public static void main (String [] args){
      	Scanner scanner = new Scanner (System.in);
      	int N = scanner.nextInt();
      	int [] arr = new int [N];
      	for (int i = 0; i < N; i++){
          	arr[i] = scanner.nextInt();
        }
      	int counter = 0;
      	for (int i = 1; i < N; i++){
          	if (arr[i-1] <= arr[i]) counter++;
        }
      	System.out.println(counter);
    }
}


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

int main() {
  int N; cin >> N;
  int visible,unvisible;
  vector<int> height(N);

  for( int i = 0; i < N; i++ )
    cin >> height.at(i);

  for( int i = 1; i < N + 1; i++ ) {
    for( int j = 1; j < i; j++ ) {
      unvisible = 0;
      if( height.at(i-1) < height.at(j-1) ) {
        unvisible++;
        break;
      }
    }
    if( unvisible == 0 )
      visible++;
  }
  cout << visible << endl;
}


#include <iostream>
using namespace std;

int main()
{
  int N;
  cin >> N;
  int H[N];
  for(int i=0;i<N;i++)
  {
    cin >> H[i];
  }

  bool judge;
  int total = 1;

  for(int i=1;i<N;i++)
  {
    for(int j=0;j<i;j++)
    {
      if(H[i]>=H[j])
      {
        judge = true;
      }
      else
      {
        judge = false;
        break;
      }
    }
    if(judge)total += 1;
  }

  cout << total << endl;

  return 0;
}


#include<iostream>
#include<string>
#include<map>
#include<algorithm>
#include<vector>
#include<iomanip>
using namespace std;

int main() {
	int N;
	cin >> N;
	int S[30];
	int cnt = 0;
	for (int i = 0; i < N; i++) {
		cin >> S[i];
	}
	for (int i = 1; i < N; i++) {
		if (S[0] <= S[i]) {
			cnt++;
			S[0] = S[i];
		}
	}
	cout << cnt+1 << endl;
}


#include <iostream>
#include <iomanip>
#include <algorithm>
#include <bitset>
#include <string>
#include <cmath>
#include <complex>
#include <numeric>
#include <cassert>

#include <vector>
#include <array>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <utility>

#define int64 long long
#define uint64 unsigned long long
#define PI 3.1415926535897932384626433832795
#define coutfix(i) cout << fixed << setprecision(i)
using namespace std;

int main()
{
	int64 nn, ans = 0;
	cin >> nn;
	vector<int64> hh(nn);
	for(int64 ii = 0;ii < nn;ii++)
	{
		cin >> hh[ii];
	}
	for(int64 ii = 1;ii < nn;ii++)
	{
		if(hh[ii - 1] <= hh[ii])
		{
			ans++;
		}
		else
		{
			hh[ii] = hh[ii - 1];
		}
	}
	cout << ans << endl;
}


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

#define rep(i,n)  for(int i=0;i<n;++i)
#define per(i,n)  for(int i=n-1;i>=0;--i)
#define sc1(a)  scanf("%d",&a)
#define sc2(a,b)  scanf("%d %d",&a,&b)
#define sc3(a,b,c)  scanf("%d %d %d",&a,&b,&c)

int main(){
    int n,m=0,ans=0;
    int h[n];
    sc1(n);
    rep(i,n) sc1(h[i]);
    rep(i,n) {
        if (h[i]>=m) {
            m=h[i];
            ans++;
        }
    }
    printf("%d\n",ans);
    return 0;
}


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

#define rep(i,n)  for(int i=0;i<n;++i)
#define per(i,n)  for(int i=n-1;i>=0;--i)
#define sc1(a)  scanf("%d",&a)
#define sc2(a,b)  scanf("%d %d",&a,&b)
#define sc3(a,b,c)  scanf("%d %d %d",&a,&b,&c)
#define sl1(a)  scanf("%lld",&a)
#define sl2(a,b)  scanf("%lld %lld",&a,&b)
#define sl3(a,b,c)  scanf("%lld %lld %lld",&a,&b,&c)
#define PI 3.1415926535897932

int lcm(int a,int b) { return a*b/__gcd(a,b); }
//long long lcm(ll a,ll b) { return a*b/__gcd(a,b); }

/**
 * sort(ar.begin(),ar.end())
 * int sum=accumulate(ar.begin(),ar.end(),0);
 **/

int main(){
    int mod=1000000007;
    int n,m=0,ans=0;
    int h[n];
    sc1(n);
    rep(i,n) sc1(h[i]);
    rep(i,n) {
        if (h[i]>=m) {
            m=h[i];
            ans++;
        }
    }
    printf("%d\n",ans);
    return 0;
}


#include<stdio.h>
int main(){
  int N,i,k=1,hight=0;
  int a[200]={};
  scanf("%d",&N);
  for(i=0;i<N;i++){
  scanf("%d",&a[i]);
  }
  //printf("%d\n",N);
  //printf("%d\n",a[1]);
  hight=a[0];
    for(i=1;i<N;i++){
      if(hight<=a[i]){
        hight=a[i];
        k=k+1;
      }
    }
  printf("%d",k);
  return 0;
}


#include<stdio.h>
int main(){
    int n, i = 0;
    scanf("%d",&n);
    int h[n];
    int ans = 1;
    for(; i < n; i++)
        scanf("%d",&h[i]);
    for(i = 1; i < n; i++){
        int f = 1;
        for(int j = 0; j < i; j++){
            if(h[j] > h[i]){
                f = 0;
                break;
            }
        }
        if(f)
            ans ++;
    }
    printf("%d\n",ans);
    return 0;
}


#include<stdio.h>

int main(){
    int input_num;
    int num[100];
    int i, j;
    int ans =1;

    scanf("%d", &input_num);

    for(i=0; i<input_num; i++){
        scanf("%d", &num[i]);
    }

    for(i=1; i<input_num; i++){
        for(j=0; j<i; j++){
            if(num[j] > num[i]){
                break;
            }
        }
        if(i == j){
            ans += 1;
        }
    }
    printf("%d", ans);
    return 0;
}


#include<stdio.h>

int main()
{
    int N,i,j,count=1;
    scanf("%d", &N);
    int H[N];
    for(i=0; i<N; i++)
        scanf("%d", &H[i]);
    for(j=1; j<N; j++)
    {
        if((H[j]>=H[0]) && (H[j]>=H[1]) && (H[j]>=H[j-1]))
            count++;
    }

    printf("%d\n", count);

    return 0;

}


#include<stdio.h>

int main()
{
    int N,i,j,count=0;
    scanf("%d", &N);
    int H[N];
    for(i=0; i<N; i++)
        scanf("%d", &H[i]);
    for(j=1; j<N; j++)
    {
        if(H[j]>=H[j-1] && H[j]>=H[0] && H[j]>=H[1])
            count++;
    }

    printf("%d\n", count+1);

    return 0;

}


#include<stdio.h>

int main()
{
    int N,i,j,count=0;
    scanf("%d", &N);
    int H[N];
    for(i=0; i<N; i++)
        scanf("%d", &H[i]);
    for(j=1; j<N; j++)
    {
        if(H[j]>H[j-1])
            count++;
    }

    printf("%d", count+1);

    return 0;

}


function Main(input) {
  input = input.split("\n");
  var n = parseInt(input[0], 10);
  input = input[1].split(" ");
  var ans = 0;
  var flg = 0;
  for (var i = 0; i < n; i++) {
    flg = 0;
    if (i == 0) {
      ans++;
    } else {
      for(var j = 0; j < i; j++) {
        if (parseInt(input[i], 10) < parseInt(input[j], 10)){
          flg = 1;
          break;
        }
      }
      if(flg == 0) {
        ans++;
      }
    }
  }
  console.log('%d',ans);
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


function Main(input) {
  var lfArgs = input.split('\n');
  var n = parseInt(lfArgs[0]);
  var hs = lfArgs[1].split(' ');
  var max = parseInt(hs[0]);
  var count = 1;
  for (var i = 1; i < n; i++) {
    if (max <= parseInt(hs[i])) {
      max = hs[i];
      count++;
    }
  }
  console.log(count);

}

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


// inputに入力データ全体が入る
function Main(input) {
	// 1行目がinput[0], 2行目がinput[1], …に入る
	input = input.split("\n");
  	var heights = input[1].split(" ");
	//文字列から10進数に変換するときはparseIntを使います
    var max = 0;
  	var count = 0;

  	heights.forEach((val) => {
      var h = parseInt(val);
      if (h >= max) {
        count++;
        max = h;
      }
    });
	//出力
	console.log(count);
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


"use strict";
const Main = (input) =>{
    let xs = input.trim().split('\n');
    let nums = xs[1].trim().split(' ').map(v=>parseInt(v,10));
    const compare = (a, b)=>{ //関数名は何でもOK
　　return a - b;  //a - b 昇順 b - a 降順
　　}
    let ans = nums.sort(compare);
    //console.log(ans);
    let count = 1;
    for(let i =0; i<xs[0]; i++){
        if(ans[i]<ans[i+1]){
        count++
        }else{
        count += 0
        }
    }
    console.log(count);

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


"use strict";
const Main = (input) =>{
    let xs = input.trim().split('\n');
    let nums = xs[1].trim().split(' ').map(v=>parseInt(v,10));
    let count = 1;
    for(let i =0; i<xs[0]; i++){
        if(nums[0]<=nums[i+1]){
        count++
        }else{
        count += 0
        }
    }
    console.log(count);

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


"use strict";
const Main = (input) =>{
    let xs = input.trim().split('\n');
    let nums = xs[1].trim().split(' ').map(v=>parseInt(v,10));
    let count = 1;
    for(let i =0; i<xs[0]; i++){
        if(nums[i]<=nums[i+1]){
        count++
        }else{
        count += 0
        }
    }
    console.log(count);

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


package main

import "fmt"

func main() {
	var N int
	fmt.Scanf("%d", &N)
	H := make([]int, N)
	for i := 0; i < N; i++ {
		fmt.Scanf("%d", &H[i])
	}
	count := 1
	max := H[0]
	for i := 1; i < N; i++ {
		if max <= H[i] {
			count++
		}
		if max < H[i] {
			max = H[i]
		}
	}
	fmt.Println(count)
}


package main

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

func main() {
	defer Flush()

	_, H := readInts(0)

	var ans, maxv int
	for _, v := range H {
		if maxv <= v {
			maxv = v
			ans++
		}
	}
	println(ans)

}

// -----------------------------------------------------------------------------

// IO helper functions

// Returns next token from input.  It must be initialized by SetInput()
// before the first call.
var nextToken func() ([]byte, error)
var nextLine func() ([]byte, error)

// Holds a buffer for output.  It must be initialized by SetOutput().
// All IO fucntions (read*() and [e]print*()) should write to OutputWriter
// instead of this.
var OutputBuffer *bufio.Writer

// Holds an io.Writer.  It must be initialized by SetOutput()
var OutputWriter io.Writer

// Set IO functions for interactive input/output.
func SetInteractive(w io.Writer, r io.Reader) {
	SetUnbefferedInput(r)
	OutputBuffer = nil
	OutputWriter = w
}

// Setup OutputBuffer and OutputWriter.
func SetOutput(w io.Writer) {
	OutputBuffer = bufio.NewWriter(w)
	OutputWriter = OutputBuffer
}

// Flushes OutputBuffer
func Flush() {
	if OutputBuffer != nil {
		OutputBuffer.Flush()
	}
}

// Returns true if c is a white space
func IsSpace(c byte) bool {
	switch c {
	case '\t', '\n', '\v', '\f', '\r', ' ':
		return true
	}
	return false
}

func IsNewLine(c byte) bool {
	switch c {
	case '\n', '\r':
		return true
	}
	return false
}

// Setup nextToken with input buffer.
func SetInput(r io.Reader) {
	buf := new(bytes.Buffer)
	var b []byte

	var i int
	rest := func() ([]byte, error) {
		for i < len(b) && IsSpace(b[i]) {
			i++
		}
		if i == len(b) {
			return nil, io.ErrUnexpectedEOF
		}
		j := i
		for i < len(b) && !IsSpace(b[i]) {
			i++
		}
		return b[j:i], nil
	}
	initial := func() ([]byte, error) {
		io.Copy(buf, r)
		b = buf.Bytes()
		nextToken = rest
		return rest()
	}
	nextToken = initial

	restLn := func() ([]byte, error) {
		for i < len(b) && IsNewLine(b[i]) {
			i++
		}
		if i == len(b) {
			return nil, io.ErrUnexpectedEOF
		}
		j := i
		for i < len(b) && !IsNewLine(b[i]) {
			i++
		}
		return b[j:i], nil
	}

	initialLn := func() ([]byte, error) {
		io.Copy(buf, r)
		b = buf.Bytes()
		nextLine = restLn
		return restLn()
	}
	nextLine = initialLn
}

// Setup nextToken without input buffer.
func SetUnbefferedInput(r io.Reader) {
	buf := bufio.NewReader(r)
	var b []byte

	var i int
	nextToken = func() ([]byte, error) {
		var err error
		if i == len(b) {
			b, err = buf.ReadBytes('\n')
			if err != nil {
				return nil, err
			}
			i = 0
			j := len(b) - 1
			for 0 <= j && IsSpace(b[j]) {
				j--
			}
			b = b[0 : j+1]
		}
		for i < len(b) && IsSpace(b[i]) {
			i++
		}
		j := i
		for i < len(b) && !IsSpace(b[i]) {
			i++
		}
		if i == j {
			return nil, io.ErrUnexpectedEOF
		}
		return b[j:i], nil
	}
}

// -----------------------------------------------------------------------------

// IO functions

// Reads next token and return it as []byte
func readb() []byte {
	b, err := nextToken()
	if err != nil {
		panic(err)
	}
	return b[:len(b):len(b)]
}

// Reads next token and return it as string
func reads() string {
	return string(readb())
}

// Read next line as []byte.  Trailing '\n' will not be included.
// See also comments on readb()
func readbln() []byte {
	b, err := nextLine()
	if err != nil {
		panic(err)
	}
	return b[:len(b):len(b)]
}

// Read next line as string
func readsln() string {
	return string(readbln())
}

// Reads next token and return it as int64
func readll() int64 {
	i, err := strconv.ParseInt(reads(), 10, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

// Reads next token and return it as int
func readi() int {
	return int(readll())
}

// Reads next token and return it as float64
func readf() float64 {
	f, err := strconv.ParseFloat(reads(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

// Write args to OutputWriter with the format f
func printf(f string, args ...interface{}) (int, error) {
	return fmt.Fprintf(OutputWriter, f, args...)
}

// Write args to OutputWriter without format
func println(args ...interface{}) (int, error) {
	return fmt.Fprintln(OutputWriter, args...)
}

// Write args to stderr with the format f
func eprintf(f string, args ...interface{}) (int, error) {
	return fmt.Fprintf(os.Stderr, f, args...)
}

// Write args to stderr without format
func eprintln(args ...interface{}) (int, error) {
	return fmt.Fprintln(os.Stderr, args...)
}

// -----------------------------------------------------------------------------

// Utilities

func sumSlice(a []int) int {
	var res int
	for _, v := range a {
		res += v
	}
	return res
}

func sumSlicell(a []int64) int64 {
	var res int64
	for _, v := range a {
		res += v
	}
	return res
}

func readInts(N int) (int, []int) {
	if N == 0 {
		N = readi()
	}
	a := make([]int, N)
	for i := range a {
		a[i] = readi()
	}
	return N, a
}

func readIntsll(N int) (int, []int64) {
	if N == 0 {
		N = readi()
	}
	a := make([]int64, N)
	for i := range a {
		a[i] = readll()
	}
	return N, a
}

// reverse slice in place
func reverse(a []int) {
	for i, j := 0, len(a)-1; i < j; i, j = i+1, j-1 {
		a[i], a[j] = a[j], a[i]
	}
}

// areverse: allocating reverse
func areverse(a []int) []int {
	b := make([]int, len(a))
	for i := range a {
		b[i] = a[len(a)-i-1]
	}
	return b
}

// -----------------------------------------------------------------------------

// Simple math functions

const (
	// big prime
	INF  = 1000000007
	INF2 = 1000000009
	INF3 = 998244353
)

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func minll(a, b int64) int64 {
	if a < b {
		return a
	}
	return b
}

func minf(a, b float64) float64 {
	if a < b {
		return a
	}
	return b
}

func max(a, b int) int {
	if a < b {
		return b
	}
	return a
}

func maxll(a, b int64) int64 {
	if a < b {
		return b
	}
	return a
}

func maxf(a, b float64) float64 {
	if a < b {
		return b
	}
	return a
}

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

func absll(a int64) int64 {
	if a < 0 {
		return -a
	}
	return a
}

func absf(a float64) float64 {
	if a < 0 {
		return -a
	}
	return a
}

// egcd(a, b) returns d, x, y:
//   d is gcd(a,b)
//   x, y are  integers that satisfy ax + by = d
func egcd(a, b int) (int, int, int) {
	if b == 0 {
		return a, 1, 0
	}
	d, x, y := egcd(b, a%b)
	return d, y, x - a/b*y
}

func egcdll(a, b int64) (int64, int64, int64) {
	if b == 0 {
		return a, 1, 0
	}
	d, x, y := egcdll(b, a%b)
	return d, y, x - a/b*y
}

func gcd(a, b int) int {
	d, _, _ := egcd(a, b)
	return d
}

func gcdll(a, b int64) int64 {
	d, _, _ := egcdll(a, b)
	return d
}

// set up IO functions
func init() {
	// for non-interactive
	SetInput(os.Stdin)
	SetOutput(os.Stdout)

	// Enable below when interactive.  Its ok to leave above intact.
	// SetInteractive(os.Stdout, os.Stdin)
}


package main

import(
	"fmt"
)

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

  	heights := make([]int,n)

  	for i := 0; i < n; i++ {
  		fmt.Scan(&heights[i])
  	}

  	hotelCnt := 1;
  	for tag := 1; tag < n; tag++ {
      	cnt := 0
  		for j := 0; j < tag; j++ {
  			if heights[tag] < heights[j] {
  				break
  			} else {
              	cnt++
  			}
  		}
  		if tag == cnt {
	  		hotelCnt++
	  	}
  	}
  	fmt.Println(hotelCnt)
}


package main

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

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

	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)

	h := make([]int, n)
	for i := 0; i < n; i++ {
		sc.Scan()
		h[i], _ = strconv.Atoi(sc.Text())
	}

	ans := 1
	max := 0
	for i := 1; i < n;i++ {
		if h[i] < h[i-1] {
			continue
		}
		ans++

		if max < h[i] {
			max = h[i]
		}
	}

	fmt.Println(ans)

}


package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scan(&n)
	hs := make([]int, n)
	for i := range hs {
		fmt.Scan(&hs[i])
	}

	var count int
	if n == 1 {
		count = 1
	} else {
		for i := 1; i < n; i++ {
			if f(hs, i) {
				count++
			}
		}
	}

	fmt.Print(count)
}

func f(hs []int, idx int) bool {
	h := hs[idx]
	for i := 0; i < idx; i++ {
		if h < hs[i] {
			return false
		}
	}
	return true
}