// A. Petya and Origami
/*
Petya is having a party soon, and he has decided to invite his 𝑛 friends.

He wants to make invitations in the form of origami. For each invitation, he needs two red sheets, five green sheets, and eight blue sheets. The store sells an infinite number of notebooks of each color, but each notebook consists of only one color with 𝑘 sheets. That is, each notebook contains 𝑘 sheets of either red, green, or blue.

Find the minimum number of notebooks that Petya needs to buy to invite all 𝑛 of his friends.

Input
The first line contains two integers 𝑛 and 𝑘 (1≤𝑛,𝑘≤108) — the number of Petya's friends and the number of sheets in each notebook respectively.

Output
Print one number — the minimum number of notebooks that Petya needs to buy.

Examples
Input
3 5

Output
10

Input
15 6

Output
38

Note
In the first example, we need 2 red notebooks, 3 green notebooks, and 5 blue notebooks.

In the second example, we need 5 red notebooks, 13 green notebooks, and 20 blue notebooks.
*/
package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)
	input, _ := reader.ReadString('\n')
	arr := strings.Split(strings.TrimSpace(input), " ")
	n, _ := strconv.ParseFloat(arr[0], 64)
	k, _ := strconv.ParseFloat(arr[1], 64)

	r := math.Ceil(float64(2.0 * n / k))
	g := math.Ceil(float64(5.0 * n / k))
	b := math.Ceil(float64(8.0 * n / k))

	fmt.Print(int64(r + g + b))

}


package main

import (
	"fmt"
)

func fun(x int, y int) int {
	ans := 2 * x / y
	if 2 * x % y != 0 {
		ans += 1
	}
	ans += 5 * x / y
	if 5 * x % y != 0 {
		ans += 1
	}
	ans += 8 * x / y
	if 8 * x % y != 0 {
		ans += 1
	}
	return ans
}

func main() {
	var a, b int
	fmt.Scan(&a, &b)
	fmt.Println(fun(a, b))
}


package main

import (
	"fmt"
)
var (
	n, m int
	ans int
)
func main() {
	fmt.Scanln(&n, &m)
	ans = 0;
	ans += (n * 2 - 1) / m + 1
	ans += (n * 5 - 1) / m + 1
	ans += (n * 8 - 1) / m + 1
	fmt.Println(ans)
}


package main

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

func main() {
	buf := bufio.NewReader(os.Stdin)
	var t int64

	fmt.Fscanf(buf, "%d\n", &t)
	var ans int64 = 1

	for  {
		if ans*ans >=t{
			ans = ans*2
			break
		}
		if ans*(ans+1) >= t{
			ans = ans*2+1
			break
		}
		ans++
	}

	fmt.Printf("%d\n", ans)
}


package main

import "fmt"
import "math"

func main(){
	var N int
	fmt.Scanf("%d",&N)
	fmt.Println(count(N))
}

func count(N int) int{
	h := 0
	v := 0
	area := h*v
	for i:= 1 ; i<=N;i++{
		if i == 1{
			h = 1
			v = 1
			area = h*v
		}else{
			if i > area && math.Mod(math.Sqrt(float64(i)),1) != 0{
				h += 1
			}else if i > area && math.Mod(math.Sqrt(float64(i)),1) == 0{
				h -=1
				v += 1
			}
			area = h*v
		}
	}
	return h+v
}


package main

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

var scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)
var writer *bufio.Writer = bufio.NewWriter(os.Stdout)

func ReadInt() int {
	scanner.Scan()
	ans, _ := strconv.Atoi(scanner.Text())
	return ans
}

func main() {
	defer writer.Flush()
    scanner.Split(bufio.ScanWords)

	n := int64(ReadInt())

	l := int64(2)
	r := int64(1000000000)

	ans := int64(0)

	for l <= r {

		mid := int64((l+r)/2)

		metade := int64(mid/2)
		metade1 := int64(mid - metade)

		total := metade*metade1

		// fmt.Println(mid, metade, metade1)

		if total >= n {
			ans = mid
			r = mid-1
		} else{
			l = mid+1
		}
	}

    writer.WriteString(strconv.FormatInt(ans,10))
}


// 388A-mic
package main

import (
    "fmt"
    "sort"
)

func main() {
    var n, cou int
    fmt.Scan(&n)
    a := make([]int, n)
    for i := range a {
        fmt.Scan(&a[i])
    }
    f := 1
    sort.Sort(sort.IntSlice(a))
    for i := 0; i < n; i++ {
        f = 1
        if a[i] != -1 {
            for j := i + 1; j < n; j++ {
                if a[j] >= f && a[j] != -1 {
                    f++
                    a[j] = -1
                }
            }
            cou++
        }
    }
    fmt.Println(cou)
}


package main
import (
	"fmt"
	"sort"
)
func main() {
	var n int
	fmt.Scan(&n)
	list:=make([]int,n+1)
	hasil:=0
	for i:=1;i<=n;i++ {
		fmt.Scan(&list[i])
	}
	sort.Ints(list)
	for i:=1;i<=n;i++ {
		if (hasil*list[i]+hasil)<i {
			hasil++
		}
	}
	fmt.Println(hasil)
}


package main

import (
    "fmt"
    "sort"
)

func main() {
    var n int
    fmt.Scan(&n)
    x := make([]int,n)
    for i := 0; i < n; i++ {
        fmt.Scan(&x[i])
    }
    sort.Ints(x)
    for k := 1; k <= n; k++ {
        ans := true
        for i := 0; i < n; i++ {
            if x[i] < (i/k) {
                ans = false
                break
            }
        }
        if ans {
            fmt.Println(k)
            break
        }
    }
}


package main
import (
	"fmt"
)
func divisors(n int) int{
	c:= 1
	for d:=2; d<100; d++{
		if (n % d == 0){
			alpha := 0;
			for ;n % d == 0; {
				n /= d
				alpha++
			}
			c *= (alpha + 1)
		}
	}
	return c
}

func main() {
	var sum , al, bl, cl int
	sum=0
	fmt.Scan(&al,&bl,&cl)
	for a := 1; a <= al; a++{
		for b := 1; b <= bl; b++{
			for c := 1; c <= cl; c++{
				sum += divisors(a*b*c);
				sum %= 1073741824;
			}
		}
	}
	fmt.Println(sum)
}


package main

import (
	"fmt"
)

var d []int

func createDivisorsArray(size int) {
	d = make([]int, size)
}

func sieve(n int) {
	createDivisorsArray(n + 1)
	for i := 1; i <= n; i++ {
		for j := i * 2; j <= n; j += i {
			d[j]++
		}
		d[i]++
	}
}

func main() {
	var a, b, c int
	fmt.Scan(&a, &b, &c)
	sieve(a * b * c)
	res := 0
	for i := 1; i <= a; i++ {
		for j := 1; j <= b; j++ {
			for k := 1; k <= c; k++ {
				res += d[i*j*k]
			}
		}
	}
	fmt.Println(res)
}


package main

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

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

// 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 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 abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

func absll(a int64) int64 {
	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)
}

func main() {
	defer Flush()

	n, a := readInts(0)
	_ = n
	p := make([]bool, 3)
	p[0] = true
	p[1] = true
	for _, v := range a {
		win := v - 1
		var lose, spect int
		if !p[win] {
			println("NO")
			return
		}
		for i := range p {
			if i == win {
				continue
			}
			if !p[i] {
				spect = i
				continue
			}
			lose = i
		}
		p[win] = true
		p[spect] = true
		p[lose] = false
	}
	println("YES")
}


package main

import (
	"fmt"
	"strconv"
	"math"
)

func main() {
	var buff string
	fmt.Scanln(&buff)
	var n int
	n, _ = strconv.Atoi(buff)

	var game byte
	game = 3

	for i := 0; i < n; i++ {
		fmt.Scanln(&buff)
		winner, _ := strconv.Atoi(buff)
		winner--
		bit := byte(math.Pow(2, float64(winner)))
		if int(game&bit) == 0 {
			fmt.Print("NO")
			return
		}
		game = ^game&7 | bit
	}

	fmt.Print("YES")
}


package main
import "fmt"

func main() {
	var n int
	fmt.Scan(&n)
	a := make([]int, n)
	for i := 0; i < n; i++ {
		fmt.Scan(&a[i])
	}

	x := 1
	y := 2
	s := 3 // spectator
	for _, v := range a {
		switch v {
		case s:
			fmt.Println("NO")
			return
		case x:
			s, y = y, s
		case y:
			s, x = x, s
		}
	}

	fmt.Println("YES")
}


package main

import (
	. "fmt"
	"io"
	"os"
	"regexp"
	"strconv"
)

// github.com/EndlessCheng/codeforces-go
func CF1618F(in io.Reader, out io.Writer) {
	var x, y uint64
	Fscan(in, &x, &y)
	if x == y {
		Fprintln(out, "YES")
		return
	}
	s := strconv.FormatUint(x, 2)
	t := strconv.FormatUint(y, 2)
	rt := []byte(t)
	for i, n := 0, len(rt); i < n/2; i++ {
		rt[i], rt[n-1-i] = rt[n-1-i], rt[i]
	}
	f := func() bool {
		r := regexp.MustCompile("^1*" + s + "1*$")
		return r.MatchString(t) || r.Match(rt)
	}
	s += "1"
	if f() {
		Fprintln(out, "YES")
		return
	}
	s = s[:len(s)-1]
	for s[len(s)-1] == '0' {
		s = s[:len(s)-1]
	}
	if f() {
		Fprintln(out, "YES")
	} else {
		Fprintln(out, "NO")
	}
}

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


package main

import (
	. "fmt"
	"regexp"
	"strconv"
	"strings"
)

// github.com/EndlessCheng/codeforces-go
func main() {
	var x, y uint64
	Scan(&x, &y)
	if x == y {
		Print("YES")
		return
	}
	t := strconv.FormatUint(y, 2)
	rev := []byte(t)
	for i, n := 0, len(rev); i < n/2; i++ {
		rev[i], rev[n-1-i] = rev[n-1-i], rev[i]
	}
	f := func(s string) bool {
		r := regexp.MustCompile("^1*" + s + "1*$")
		return r.MatchString(t) || r.Match(rev)
	}
	s := strconv.FormatUint(x, 2)
	if f(s+"1") || f(strings.TrimRight(s, "0")) {
		Print("YES")
	} else {
		Print("NO")
	}
}


package main

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

var (
	writer  = bufio.NewWriter(os.Stdout)
	scanner = bufio.NewScanner(os.Stdin)
)

func main() {
	defer writer.Flush()
	scanner.Split(bufio.ScanWords)

	n, x, y := nextInt(), nextInt64(), nextInt64()
	a := make([]int64, n+1)

	dp(a, x, y)
	println(a[n])
}

func dp(a []int64, x, y int64) {
	for i := 1; i < len(a); i++ {
		if i%2 == 0 {
			a[i] = min(a[i-1]+x, a[i/2]+y)
		} else {
			a[i] = min(a[i-1]+x, min(a[i/2], a[(i+1)/2])+x+y)
		}
	}
}

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

	return b
}

func next() string {
	if !scanner.Scan() {
		panic(scanner.Err())
	}
	return scanner.Text()
}

func nextInt64() int64 {
	n, _ := strconv.ParseInt(next(), 0, 64)
	return n
}

func nextInt() int {
	n, _ := strconv.Atoi(next())
	return n
}

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

func println(a ...interface{})               { fmt.Fprintln(writer, a...) }
func print(a ...interface{})                 { fmt.Fprint(writer, a...) }
func printf(format string, a ...interface{}) { fmt.Fprintf(writer, format, a...) }


package main

import "strconv"
import "os"
import "bufio"

var in *bufio.Scanner
var out *bufio.Writer

func min(x int64, y int64) int64 {
	if x < y {
		return x
	}
	return y
}

func dp(n int, x int64, y int64) int64 {
	f := make([]int64, n+1)

	f[0] = 0
	for i := 1; i <= n; i++ {
		if i%2 == 0 {
			f[i] = min(f[i-1]+x, f[i/2]+y)
		} else {
			f[i] = min(f[i-1]+x, f[(i+1)/2]+y+x)
		}
	}

	return f[n]
}

func main() {
	in = bufio.NewScanner(os.Stdin)
	out = bufio.NewWriter(os.Stdout)

	in.Split(bufio.ScanWords)
	defer out.Flush()

	in.Scan()
	n, _ := strconv.Atoi(in.Text())

	in.Scan()
	x, _ := strconv.Atoi(in.Text())

	in.Scan()
	y, _ := strconv.Atoi(in.Text())

	res := dp(n, int64(x), int64(y))

	out.WriteString(strconv.FormatInt(res, 10))
	out.WriteByte('\n')
}


// http://codeforces.com/problemset/problem/710/E

package main

import (
	"fmt"
)

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

	return b
}

func main() {
	var n int
	var x, y int64

	fmt.Scanln(&n, &x, &y)
	times := make([]int64, n)

	times[0] = x
	for i := 1; i < n; i++ {
		if i % 2 == 0 {
			// odd
			times[i] = min(x + times[i - 1], y + times[i / 2] + x)
		} else {
			// even
			times[i] = min(x + times[i - 1], y + times[i / 2])
		}
	}

	fmt.Println(times[n - 1])
}


package main

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

func Init() {
}

func Solve(io *FastIO) {
	N := io.NextInt()

	cnt := 0
	for a := 1; a <= N; a++ {
	  for b := a; b <= N; b++ {
	    c := a ^ b
	    if c < b {
	      continue
	    }
	    if c > b - a && c < b + a && c <= N {
	      cnt++
	    }
	  }
	}
	io.Println(cnt)
}

type FastIO struct {
	reader *bufio.Reader
	writer *bufio.Writer
}

func (io *FastIO) NextChar() byte {
	c, _ := io.reader.ReadByte()
	return c
}

func (io *FastIO) NextInt() int {
	c := io.NextChar()
	for IsSpaceChar(c) {
		c = io.NextChar()
	}
	sgn := 1
	if c == '-' {
		sgn = -1
		c = io.NextChar()
	}
	res := 0
	for !IsSpaceChar(c) {
		res = (res * 10) + int(c - '0')
		c = io.NextChar()
	}
	return sgn * res
}

func (io *FastIO) NextLong() int64 {
	c := io.NextChar()
	for IsSpaceChar(c) {
		c = io.NextChar()
	}
	sgn := int64(1)
	if c == '-' {
		sgn = -1
		c = io.NextChar()
	}
	res := int64(0)
	for !IsSpaceChar(c) {
		res = (res * 10) + int64(c - '0')
		c = io.NextChar()
	}
	return sgn * res
}

func (io *FastIO) NextIntArray(size int) []int {
	return io.NextIntArrayOffset(size, 0)
}

func (io *FastIO) NextIntArrayOffset(size, offset int) []int {
	arr := make([]int, size + offset)
	for i := 0; i < size; i++ {
		arr[i + offset] = io.NextInt()
	}
	return arr
}

func (io *FastIO) NextLongArray(size int) []int64 {
	return io.NextLongArrayOffset(size, 0)
}

func (io *FastIO) NextLongArrayOffset(size, offset int) []int64 {
	arr := make([]int64, size + offset)
	for i := 0; i < size; i++ {
		arr[i + offset] = io.NextLong()
	}
	return arr
}

func (io *FastIO) NextString() string {
	c := io.NextChar()
	for (IsSpaceChar(c)) {
		c = io.NextChar()
	}
	var sb bytes.Buffer
	for !IsSpaceChar(c) {
		sb.WriteByte(c)
		c = io.NextChar()
	}
	return sb.String()
}

func (io *FastIO) NextLine() string {
	c := io.NextChar()
	for (IsSpaceChar(c)) {
		c = io.NextChar()
	}
	var sb bytes.Buffer
	for !IsLineBreakChar(c) {
		sb.WriteByte(c)
		c = io.NextChar()
	}
	return sb.String()
}

func (io *FastIO) Println(args ...interface{}) {
	io.writer.WriteString(fmt.Sprintln(args...))
}

func (io *FastIO) Printf(format string, args ...interface{}) {
	io.writer.WriteString(fmt.Sprintf(format, args...))
}

func (io *FastIO) FlushOutput() {
	io.writer.Flush()
}

func IsSpaceChar(c byte) bool {
	switch c {
	case 0, '\t', '\n', '\r', ' ':
		return true
	default:
		return false
	}
}

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

func main() {
	io := FastIO{reader: bufio.NewReader(os.Stdin), writer: bufio.NewWriter(os.Stdout)}
	Init()
	Solve(&io)
	io.FlushOutput()
}


package main

import (
  "fmt"
)

func main() {
  var total, downloaded, q float64
  fmt.Scanf("%f %f %f", &total, &downloaded, &q)

  var listened = 0.0
  var ans = 0

  for {
    ans++

    var t = (downloaded - listened) * q
    if t >= total {
      break
    } else {
      downloaded = t
      listened = 0
    }
  }

  fmt.Println(ans)
}


package main

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

var reader *bufio.Reader = bufio.NewReader(os.Stdin)
var writer *bufio.Writer = bufio.NewWriter(os.Stdout)

func printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }
func scanf(f string, a ...interface{})  { fmt.Fscanf(reader, f, a...) }
func scanInt(a interface{})             { fmt.Fscanf(reader, "%d", a) }
func scanlnInt(a interface{})           { fmt.Fscanf(reader, "%d\n", a) }
func scanChar(a interface{})            { fmt.Fscanf(reader, "%c", a) }
func scanString(a interface{})          { fmt.Fscanf(reader, "%s", a) }

func max(a, b int64) int64 {
	if a > b {
		return a
	}
	return b
}

func main() {
	defer writer.Flush()

	a := make([]int64, 14)
	for i := range a {
		scanInt(&a[i])
	}
	maxcount := int64(0)
	for i := int64(0); i < 14; i++ {
		count, k := int64(0), a[i]
		a[i] = 0
		for j := int64(0); j < 14; j++ {
			n := a[(i+j)%14] + k/14
			if (j-1+14)%14 < k%14 {
				n++
			}
			if n%2 == 0 {
				count += n
			}
		}
		maxcount, a[i] = max(maxcount, count), k
	}
	printf("%d", maxcount)
}


package main

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

var reader *bufio.Reader = bufio.NewReader(os.Stdin)
var writer *bufio.Writer = bufio.NewWriter(os.Stdout)

func printF(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }
func scanF(f string, a ...interface{})  { fmt.Fscanf(reader, f, a...) }
func scanSlice(n int) []int64 {
	a := make([]int64, n)
	l, _ := reader.ReadString('\n')
	s := strings.Split(strings.TrimSpace(l), " ")
	for i := 0; i < n; i++ {
		a[i], _ = strconv.ParseInt(s[i], 10, 0)
	}
	return a
}

func max(a, b int64) int64 {
	if a > b {
		return a
	}
	return b
}

func main() {
	defer writer.Flush()

	a := scanSlice(14)

	maxcount := int64(0)
	for i := range a {
		if a[i] == 0 {
			continue
		}
		count, k := int64(0), a[i]
		a[i] = 0
		for j := range a {
			n := a[(i+j)%14] + k/14
			if (int64(j)-1+14)%14 < k%14 {
				n++
			}
			if n%2 == 0 {
				count += n
			}
		}
		maxcount, a[i] = max(maxcount, count), k
	}
	printF("%d", maxcount)
}


package main

import "fmt"

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

	// x1  a  x2
	// b   x3  c
	// x4  d  x5

	// x1
	// x2 = x1 - c + b
	// x4 = x1 + a - d
	// x5 = x1 + a + b - c - d
	var ans uint64
	ans = 0
	for x1 := 1; x1 <= n; x1++ {
		x2 := x1 - c + b
		x4 := x1 + a - d
		x5 := x1 + a + b - c - d

		if x2 >= 1 && x2 <= n && x4 >= 1 && x4 <= n && x5 >= 1 && x5 <= n {
			ans++
		}
	}

	fmt.Println(ans * uint64(n))
}


package main

import (
	"fmt"
	"io/ioutil"
	"os"
)

// a+b+e+g == a+c+f+g == b+d+g+h == c+d+g+i
//
// b+e = c+f
// a+f = d+i
// b+h = c+i
// a+e = d+h
//
// e-f = c-b
// h-i = c-b
// e-h = d-a
// f-i = d-a
//
// f+h = e+i
//
// g can be anything from 1 to n
// assume c >= b && d >= a (problem is symmetric)
// i can be from 1 to (n-(c-b)-(d-a))
// h = i + (c-b); from (1+(c-b)) to (n-(d-a))
// f = i + (d-a); from (1+(d-a)) to (n-(c-b))
// e = i + (c-b) + (d-a); from (1+(c-b)+(d-a)) to n
//
// total combinations: n * (n-(c-b)-(d-a)) assuming c>=b && d>=a
//
func Combinations(n, a, b, c, d uint64) uint64 {
	if b > c {
		c, b = b, c
	}
	if a > d {
		d, a = a, d
	}
	if (c-b)+(d-a) >= n {
		return 0
	}
	return n*(n-(c-b)-(d-a))
}

func CombinationsStr(s string) string {
	var n, a, b, c, d uint64
	fmt.Sscanf(s, "%d %d %d %d %d", &n, &a, &b, &c, &d)
	res := Combinations(n, a, b, c, d)
	return fmt.Sprint(res)
}

func main() {
	// fmt.Println(CombinationsStr("2 1 1 1 2")) // 2
	// fmt.Println(CombinationsStr("3 3 1 2 3")) // 6
	buf, err := ioutil.ReadAll(os.Stdin)
	if err != nil {
		panic(err)
	}
	res := CombinationsStr(string(buf))
	fmt.Println(res)
}


package main

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

func main() { fmt.Println(sol()) }

func sol() int64 {
	n := getInt()
	a := getInt()
	b := getInt()
	c := getInt()
	d := getInt()

	e, f, g, h := a+b, b+d, d+c, c+a
	mx := max(max(e, f), max(g, h))
	mn := min(min(e, f), min(g, h))

	x := mx + 1 - mn
	if n-x < 0 {
		return 0
	}
	return int64(n-x+1) * int64(n)
}

type Input struct {
	*bufio.Scanner
}

var globalInput = wrapStdin()

func wrapStdin() Input {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	return Input{Scanner: sc}
}
func getInt() int {
	globalInput.Scan()
	x, _ := strconv.Atoi(globalInput.Text())
	return x
}
func getIntOk() (int, bool) {
	ok := globalInput.Scan()
	x, _ := strconv.Atoi(globalInput.Text())
	return x, ok
}
func getNint(n int) []int {
	v := make([]int, n)
	for i := 0; i < n; i++ {
		v[i] = getInt()
	}
	return v
}
func getVint(v []int) bool {
	var ok bool
	for i := 0; i < len(v); i++ {
		v[i], ok = getIntOk()
	}
	return ok
}
func getWord() string {
	globalInput.Scan()
	return globalInput.Text()
}
func getWordOk() (string, bool) {
	ok := globalInput.Scan()
	return globalInput.Text(), ok
}

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
}
func min64(a, b int64) int64 {
	if a < b {
		return a
	}
	return b
}
func max64(a, b int64) int64 {
	if a < b {
		return b
	}
	return a
}
func minStr(a, b string) string {
	if a < b {
		return a
	}
	return b
}
func maxStr(a, b string) string {
	if a < b {
		return b
	}
	return a
}
func remin(a *int, b int) bool {
	if b < *a {
		*a = b
		return true
	}
	return false
}
func remax(a *int, b int) bool {
	if b > *a {
		*a = b
		return true
	}
	return false
}
func remin64(a *int64, b int64) bool {
	if b < *a {
		*a = b
		return true
	}
	return false
}
func remax64(a *int64, b int64) bool {
	if b > *a {
		*a = b
		return true
	}
	return false
}
func reminStr(a *string, b string) bool {
	if b < *a {
		*a = b
		return true
	}
	return false
}
func remaxStr(a *string, b string) bool {
	if b > *a {
		*a = b
		return true
	}
	return false
}

func abs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}
func abs64(x int64) int64 {
	if x < 0 {
		return -x
	}
	return x
}

type (
	FLess    func(i, j int) bool
	FSwap    func(i, j int)
	wrapSort struct {
		Length int
		FLess
		FSwap
	}
)

func (w *wrapSort) Len() int           { return w.Length }
func (w *wrapSort) Less(i, j int) bool { return w.FLess(i, j) }
func (w *wrapSort) Swap(i, j int)      { w.FSwap(i, j) }
func wsort(length int, fless func(i, j int) bool, fswap func(i, j int)) {
	sort.Sort(&wrapSort{length, fless, fswap})
}


package main

import (
	"fmt"
)

func main() {
	var n, v int
	fmt.Scan(&n, &v)
	v++
	dp := make([][]int, n)
	for i := range dp {
		dp[i] = make([]int, v)
	}
	for i := range dp {
		for j := range dp[i] {
			if i == 0 {
				if j > 0 {
					dp[i][j] = dp[i][j-1] + i + 1
				}
			} else {
				if j == 0 {
					dp[i][j] = dp[i-1][j+1]
				} else if j == v-1 {
					dp[i][j] = dp[i][j-1] + i + 1
				} else {
					dp[i][j] = min(dp[i-1][j+1], dp[i][j-1]+i+1)
				}
			}
		}
	}
	m := int(1e9)
	for i := 0; i < v; i++ {
		m = min(m, dp[n-1][i])
	}
	fmt.Println(m)
}

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


package main

import "fmt"

func solve(n, v int) int {
	res := v
	if n-1 <= v {
		res = n - 1
	}
	for i := 2; i < n; i++ {
		if i <= n-v {
			res += i
		}
	}
	return res
}

func main() {
	n, v := 0, 0

	fmt.Scan(&n, &v)
	fmt.Println(solve(n, v))
}


package main

import (
	"bufio"
	"os"
	"fmt"
)
var reader *bufio.Reader = bufio.NewReader(os.Stdin)
var writer *bufio.Writer = bufio.NewWriter(os.Stdout)
func printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }
func scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }
func readLine()(string,error) 			{ return reader.ReadString('\n') }

func main() {
	defer writer.Flush()
	var n, v int
	scanf("%d %d", &n, &v)
	var c int;
	if (n <= v) {
		c = n - 1
	} else {
		c = v
		for i := 2; i <= n-v; i++ {
			c +=  i
		}
	}
	printf("%d\n" ,c)
}


package main

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

func main() {
	buf := &bytes.Buffer{}
	for i := 0; i < 400; i++ {
		fmt.Fprintf(buf, "%d", i)
	}
	fmt.Println(buf.Bytes()[getInt()] - '0')
}

type Input struct {
	*bufio.Scanner
}

var globalInput = wrapStdin()

func wrapStdin() Input {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	return Input{Scanner: sc}
}
func getInt() int {
	globalInput.Scan()
	x, _ := strconv.Atoi(globalInput.Text())
	return x
}
func getIntOk() (int, bool) {
	ok := globalInput.Scan()
	x, _ := strconv.Atoi(globalInput.Text())
	return x, ok
}
func getNint(n int) []int {
	v := make([]int, n)
	for i := 0; i < n; i++ {
		v[i] = getInt()
	}
	return v
}
func getVint(v []int) bool {
	var ok bool
	for i := 0; i < len(v); i++ {
		v[i], ok = getIntOk()
	}
	return ok
}


package main

import "fmt"
import "strconv"

func main() {
    var n int
    fmt.Scan(&n)
    str := "0"
    for i:=1; i<=n; i++{
        s := strconv.Itoa(i)
        str += s
    }
    fmt.Printf("%c", str[n])
}


package main

import (
         "fmt"
       )

func splitToDigits(n int) []int {
    var a []int = make([]int, 0)
    for n > 0 {
        a = append(a, n%10)
        n = n/10
    }
    return a
}

func main() {
    var n int
    fmt.Scanf("%v\n", &n)
    pos := 0
    for q := 1; q <= n; q++ {
        a := splitToDigits(q)
        pos += len(a)
        //fmt.Printf("%v %v\n", pos, a)
        if pos == n {
            fmt.Printf("%v", a[0])
            return
        } else if pos > n {
            for i := 0; i < len(a); i++ {
                pos -= 1
                if pos == n-1 {
                    fmt.Printf("%v", a[i])
                    return
                }
            }
        }
    }
}


package main

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

var scanner *bufio.Scanner

func getI64() int64 {
  scanner.Scan()
  x, _ := strconv.ParseInt(scanner.Text(), 10, 64)
  return x
}
func getI() int {
  return int(getI64())
}
func getF() float64 {
  scanner.Scan()
  x, _ := strconv.ParseFloat(scanner.Text(), 64)
  return x
}
func getS() string {
  scanner.Scan()
  return scanner.Text()
}

func main() {
  scanner = bufio.NewScanner(os.Stdin)
  scanner.Split(bufio.ScanWords)
  writer := bufio.NewWriter(os.Stdout)
  defer writer.Flush()

  total, found, min, max := getI(), getI(), getI(), getI()
  foundMin, foundMax := false, false
  for i := 0; i < found; i++ {
    x := getI()
    if x < min || x > max {
      writer.WriteString("Incorrect\n")
      return
    }
    if x == min {
      foundMin = true
    } else if x == max {
      foundMax = true
    }
  }
  result := "Correct"
  if !foundMin && !foundMax && total-found == 1 {
    result = "Incorrect"
  }
  writer.WriteString(fmt.Sprintf("%s\n", result))
}


package main
import "fmt"

func main() {
	sdeck := make([]string, 8)
	for i := 0; i < 8; i++{
		fmt.Scan(&sdeck[i])
	}
	var deck [8][8]int
	count := 0
	for i, s := range sdeck{
		for j, c := range s{
			if c == 'B'{
				deck[i][j] = 1
			}else{
				deck[i][j] = 0
			}
		}
	}
	for i := 0; i < 8; i++{
		sum := 0
		for j := 0; j < 8; j++ {
			if deck[i][j] == 1{
				sum++
			}
		}
		if sum == 8 {
			count++
		}
	}
	if count < 8{
		for i := 0; i < 8; i++{
			sum := 0
			for j := 0; j < 8; j++ {
				if deck[j][i] == 1{
					sum++
				}
			}
			if sum == 8 {
				count++
			}
		}
	}
	fmt.Print(count)
}


// 7A
package main

import (
	"fmt"
)

func main() {
	s := make([]string, 8)
	var i, j int
	c, k, r := 0, 0, 0
	for i = 0; i < 8; i++ {
		k = 0
		fmt.Scan(&s[i])
		for j = 0; j < 8; j++ {
			if s[i][j] == 'B' {
				k++
			}
		}
		if k == 8 {
			c = c + 1
		} else {
			r = k
		}
	}
	fmt.Println(c + r)
	return
}


package main

import (
	"strings"
	"fmt"
	"strconv"
	"errors"
	"io"
	"unicode/utf8"
	"bytes"
	"os"
)

func main() {
	board := make([][]rune, 8)
	for i := 0; i < 8; i++ {
		board[i] = []rune(nextWord())
	}
	total := 0
	for i := 0; i < 8; i++ {
		count := 0
		for j := 0; j < 8; j++ {
			if board[i][j] == 'B' {
				count++
			}
		}
		if count == 8 {
			for j := 0; j < 8; j++ {
				board[i][j] = 'A'
			}
			total++
		}
	}
	for i := 0; i < 8; i++ {
		for j := 0; j < 8; j++ {
			if board[j][i] == 'B' {
				total++
				break
			}
		}
	}
	printf("%d\n", total)
}

var lineScanner *Scanner
var wordScanner *Scanner

func init() {
	lineScanner = NewScanner(os.Stdin)
	wordScanner = NewScanner(strings.NewReader(""))
	wordScanner.Split(ScanWords)
}

func printf(format string, a ...interface{}) {
	fmt.Printf(format, a...)
}
func nextLine() (string, error) {
	if !lineScanner.Scan() {
		if err := lineScanner.Err(); err != nil {
			panic(err)
		}
		return "", errors.New("nextLine: EOF reached")
	}
	return lineScanner.Text(), nil
}

func nextWord() string {
	for !wordScanner.Scan() {
		if err := wordScanner.Err(); err != nil {
			panic(err)
		}
		line, err := nextLine()
		if err != nil {
			return ""
		}
		wordScanner = NewScanner(strings.NewReader(line))
		wordScanner.Split(ScanWords)
	}
	return wordScanner.Text()
}

func nextInt() int {
	res, err := strconv.Atoi(nextWord())
	if err != nil {
		panic(err)
	}
	return res
}

func nextInt64() int64 {
	res, err := strconv.ParseInt(nextWord(), 10, 64)
	if err != nil {
		panic(err)
	}
	return res
}

func nextFloat64() float64 {
	res, err := strconv.ParseFloat(nextWord(), 64)
	if err != nil {
		panic(err)
	}
	return res
}

// Scanner provides a convenient interface for reading data such as
// a file of newline-delimited lines of text. Successive calls to
// the Scan method will step through the 'tokens' of a file, skipping
// the bytes between the tokens. The specification of a token is
// defined by a split function of type SplitFunc; the default split
// function breaks the input into lines with line termination stripped. Split
// functions are defined in this package for scanning a file into
// lines, bytes, UTF-8-encoded runes, and space-delimited words. The
// client may instead provide a custom split function.
//
// Scanning stops unrecoverably at EOF, the first I/O error, or a token too
// large to fit in the buffer. When a scan stops, the reader may have
// advanced arbitrarily far past the last token. Programs that need more
// control over error handling or large tokens, or must run sequential scans
// on a reader, should use bufio.Reader instead.
//
type Scanner struct {
	r            io.Reader // The reader provided by the client.
	split        SplitFunc // The function to split the tokens.
	maxTokenSize int       // Maximum size of a token; modified by tests.
	token        []byte    // Last token returned by split.
	buf          []byte    // Buffer used as argument to split.
	start        int       // First non-processed byte in buf.
	end          int       // End of data in buf.
	err          error     // Sticky error.
	empties      int       // Count of successive empty tokens.
	scanCalled   bool      // Scan has been called; buffer is in use.
	done         bool      // Scan has finished.
}

// SplitFunc is the signature of the split function used to tokenize the
// input. The arguments are an initial substring of the remaining unprocessed
// data and a flag, atEOF, that reports whether the Reader has no more data
// to give. The return values are the number of bytes to advance the input
// and the next token to return to the user, plus an error, if any. If the
// data does not yet hold a complete token, for instance if it has no newline
// while scanning lines, SplitFunc can return (0, nil, nil) to signal the
// Scanner to read more data into the slice and try again with a longer slice
// starting at the same point in the input.
//
// If the returned error is non-nil, scanning stops and the error
// is returned to the client.
//
// The function is never called with an empty data slice unless atEOF
// is true. If atEOF is true, however, data may be non-empty and,
// as always, holds unprocessed text.
type SplitFunc func(data []byte, atEOF bool) (advance int, token []byte, err error)

// Errors returned by Scanner.
var (
	ErrTooLong = errors.New("bufio.Scanner: token too long")
	ErrNegativeAdvance = errors.New("bufio.Scanner: SplitFunc returns negative advance count")
	ErrAdvanceTooFar = errors.New("bufio.Scanner: SplitFunc returns advance count beyond input")
)

const (
// MaxScanTokenSize is the maximum size used to buffer a token
// unless the user provides an explicit buffer with Scan.Buffer.
// The actual maximum token size may be smaller as the buffer
// may need to include, for instance, a newline.
	MaxScanTokenSize = 2 * 1024 * 2014

	startBufSize = 4096 // Size of initial allocation for buffer.
)

// NewScanner returns a new Scanner to read from r.
// The split function defaults to ScanLines.
func NewScanner(r io.Reader) *Scanner {
	return &Scanner{
		r:            r,
		split:        ScanLines,
		maxTokenSize: MaxScanTokenSize,
	}
}

// Err returns the first non-EOF error that was encountered by the Scanner.
func (s *Scanner) Err() error {
	if s.err == io.EOF {
		return nil
	}
	return s.err
}

// Bytes returns the most recent token generated by a call to Scan.
// The underlying array may point to data that will be overwritten
// by a subsequent call to Scan. It does no allocation.
func (s *Scanner) Bytes() []byte {
	return s.token
}

// Text returns the most recent token generated by a call to Scan
// as a newly allocated string holding its bytes.
func (s *Scanner) Text() string {
	return string(s.token)
}

// ErrFinalToken is a special sentinel error value. It is intended to be
// returned by a Split function to indicate that the token being delivered
// with the error is the last token and scanning should stop after this one.
// After ErrFinalToken is received by Scan, scanning stops with no error.
// The value is useful to stop processing early or when it is necessary to
// deliver a final empty token. One could achieve the same behavior
// with a custom error value but providing one here is tidier.
// See the emptyFinalToken example for a use of this value.
var ErrFinalToken = errors.New("final token")

// Scan advances the Scanner to the next token, which will then be
// available through the Bytes or Text method. It returns false when the
// scan stops, either by reaching the end of the input or an error.
// After Scan returns false, the Err method will return any error that
// occurred during scanning, except that if it was io.EOF, Err
// will return nil.
// Scan panics if the split function returns 100 empty tokens without
// advancing the input. This is a common error mode for scanners.
func (s *Scanner) Scan() bool {
	if s.done {
		return false
	}
	s.scanCalled = true
	// Loop until we have a token.
	for {
		// See if we can get a token with what we already have.
		// If we've run out of data but have an error, give the split function
		// a chance to recover any remaining, possibly empty token.
		if s.end > s.start || s.err != nil {
			advance, token, err := s.split(s.buf[s.start:s.end], s.err != nil)
			if err != nil {
				if err == ErrFinalToken {
					s.token = token
					s.done = true
					return true
				}
				s.setErr(err)
				return false
			}
			if !s.advance(advance) {
				return false
			}
			s.token = token
			if token != nil {
				if s.err == nil || advance > 0 {
					s.empties = 0
				} else {
					// Returning tokens not advancing input at EOF.
					s.empties++
					if s.empties > 100 {
						panic("bufio.Scan: 100 empty tokens without progressing")
					}
				}
				return true
			}
		}
		// We cannot generate a token with what we are holding.
		// If we've already hit EOF or an I/O error, we are done.
		if s.err != nil {
			// Shut it down.
			s.start = 0
			s.end = 0
			return false
		}
		// Must read more data.
		// First, shift data to beginning of buffer if there's lots of empty space
		// or space is needed.
		if s.start > 0 && (s.end == len(s.buf) || s.start > len(s.buf) / 2) {
			copy(s.buf, s.buf[s.start:s.end])
			s.end -= s.start
			s.start = 0
		}
		// Is the buffer full? If so, resize.
		if s.end == len(s.buf) {
			// Guarantee no overflow in the multiplication below.
			const maxInt = int(^uint(0) >> 1)
			if len(s.buf) >= s.maxTokenSize || len(s.buf) > maxInt / 2 {
				s.setErr(ErrTooLong)
				return false
			}
			newSize := len(s.buf) * 2
			if newSize == 0 {
				newSize = startBufSize
			}
			if newSize > s.maxTokenSize {
				newSize = s.maxTokenSize
			}
			newBuf := make([]byte, newSize)
			copy(newBuf, s.buf[s.start:s.end])
			s.buf = newBuf
			s.end -= s.start
			s.start = 0
			continue
		}
		// Finally we can read some input. Make sure we don't get stuck with
		// a misbehaving Reader. Officially we don't need to do this, but let's
		// be extra careful: Scanner is for safe, simple jobs.
		for loop := 0;; {
			n, err := s.r.Read(s.buf[s.end:len(s.buf)])
			s.end += n
			if err != nil {
				s.setErr(err)
				break
			}
			if n > 0 {
				s.empties = 0
				break
			}
			loop++
			if loop > 10 {
				s.setErr(io.ErrNoProgress)
				break
			}
		}
	}
}

// advance consumes n bytes of the buffer. It reports whether the advance was legal.
func (s *Scanner) advance(n int) bool {
	if n < 0 {
		s.setErr(ErrNegativeAdvance)
		return false
	}
	if n > s.end - s.start {
		s.setErr(ErrAdvanceTooFar)
		return false
	}
	s.start += n
	return true
}

// setErr records the first error encountered.
func (s *Scanner) setErr(err error) {
	if s.err == nil || s.err == io.EOF {
		s.err = err
	}
}

// Buffer sets the initial buffer to use when scanning and the maximum
// size of buffer that may be allocated during scanning. The maximum
// token size is the larger of max and cap(buf). If max <= cap(buf),
// Scan will use this buffer only and do no allocation.
//
// By default, Scan uses an internal buffer and sets the
// maximum token size to MaxScanTokenSize.
//
// Buffer panics if it is called after scanning has started.
func (s *Scanner) Buffer(buf []byte, max int) {
	if s.scanCalled {
		panic("Buffer called after Scan")
	}
	s.buf = buf[0:cap(buf)]
	s.maxTokenSize = max
}

// Split sets the split function for the Scanner.
// The default split function is ScanLines.
//
// Split panics if it is called after scanning has started.
func (s *Scanner) Split(split SplitFunc) {
	if s.scanCalled {
		panic("Split called after Scan")
	}
	s.split = split
}

// Split functions

// ScanBytes is a split function for a Scanner that returns each byte as a token.
func ScanBytes(data []byte, atEOF bool) (advance int, token []byte, err error) {
	if atEOF && len(data) == 0 {
		return 0, nil, nil
	}
	return 1, data[0:1], nil
}

var errorRune = []byte(string(utf8.RuneError))

// ScanRunes is a split function for a Scanner that returns each
// UTF-8-encoded rune as a token. The sequence of runes returned is
// equivalent to that from a range loop over the input as a string, which
// means that erroneous UTF-8 encodings translate to U+FFFD = "\xef\xbf\xbd".
// Because of the Scan interface, this makes it impossible for the client to
// distinguish correctly encoded replacement runes from encoding errors.
func ScanRunes(data []byte, atEOF bool) (advance int, token []byte, err error) {
	if atEOF && len(data) == 0 {
		return 0, nil, nil
	}

	// Fast path 1: ASCII.
	if data[0] < utf8.RuneSelf {
		return 1, data[0:1], nil
	}

	// Fast path 2: Correct UTF-8 decode without error.
	_, width := utf8.DecodeRune(data)
	if width > 1 {
		// It's a valid encoding. Width cannot be one for a correctly encoded
		// non-ASCII rune.
		return width, data[0:width], nil
	}

	// We know it's an error: we have width==1 and implicitly r==utf8.RuneError.
	// Is the error because there wasn't a full rune to be decoded?
	// FullRune distinguishes correctly between erroneous and incomplete encodings.
	if !atEOF && !utf8.FullRune(data) {
		// Incomplete; get more bytes.
		return 0, nil, nil
	}

	// We have a real UTF-8 encoding error. Return a properly encoded error rune
	// but advance only one byte. This matches the behavior of a range loop over
	// an incorrectly encoded string.
	return 1, errorRune, nil
}

// dropCR drops a terminal \r from the data.
func dropCR(data []byte) []byte {
	if len(data) > 0 && data[len(data) - 1] == '\r' {
		return data[0 : len(data) - 1]
	}
	return data
}

// ScanLines is a split function for a Scanner that returns each line of
// text, stripped of any trailing end-of-line marker. The returned line may
// be empty. The end-of-line marker is one optional carriage return followed
// by one mandatory newline. In regular expression notation, it is `\r?\n`.
// The last non-empty line of input will be returned even if it has no
// newline.
func ScanLines(data []byte, atEOF bool) (advance int, token []byte, err error) {
	if atEOF && len(data) == 0 {
		return 0, nil, nil
	}
	if i := bytes.IndexByte(data, '\n'); i >= 0 {
		// We have a full newline-terminated line.
		return i + 1, dropCR(data[0:i]), nil
	}
	// If we're at EOF, we have a final, non-terminated line. Return it.
	if atEOF {
		return len(data), dropCR(data), nil
	}
	// Request more data.
	return 0, nil, nil
}

// isSpace reports whether the character is a Unicode white space character.
// We avoid dependency on the unicode package, but check validity of the implementation
// in the tests.
func isSpace(r rune) bool {
	if r <= '\u00FF' {
		// Obvious ASCII ones: \t through \r plus space. Plus two Latin-1 oddballs.
		switch r {
		case ' ', '\t', '\n', '\v', '\f', '\r':
			return true
		case '\u0085', '\u00A0':
			return true
		}
		return false
	}
	// High-valued ones.
	if '\u2000' <= r && r <= '\u200a' {
		return true
	}
	switch r {
	case '\u1680', '\u2028', '\u2029', '\u202f', '\u205f', '\u3000':
		return true
	}
	return false
}

// ScanWords is a split function for a Scanner that returns each
// space-separated word of text, with surrounding spaces deleted. It will
// never return an empty string. The definition of space is set by
// unicode.IsSpace.
func ScanWords(data []byte, atEOF bool) (advance int, token []byte, err error) {
	// Skip leading spaces.
	start := 0
	for width := 0; start < len(data); start += width {
		var r rune
		r, width = utf8.DecodeRune(data[start:])
		if !isSpace(r) {
			break
		}
	}
	// Scan until space, marking end of word.
	for width, i := 0, start; i < len(data); i += width {
		var r rune
		r, width = utf8.DecodeRune(data[i:])
		if isSpace(r) {
			return i + width, data[start:i], nil
		}
	}
	// If we're at EOF, we have a final, non-empty, non-terminated word. Return it.
	if atEOF && len(data) > start {
		return len(data), data[start:], nil
	}
	// Request more data.
	return start, nil, nil
}


package main

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

func main() {
	input := bufio.NewReader(os.Stdin)
	var n, l, r int

	_, err := fmt.Fscan(input, &n, &l, &r)
	if err != nil {
	}

	var arrMin = make([]int, n)
	var arrMax = make([]int, n)
	var min, max int
	arrMin[0] = 1
	arrMax[0] = 1
	min += arrMin[0]
	max += arrMax[0]
	if n == 1 {
		fmt.Println(1, 1)
		return
	}
	for i := 1; i < n; i++ {
		if (i + 1) <= l {
			arrMin[i] = 2 * arrMin[i-1]
		} else {
			arrMin[i] = 1
		}
		min += arrMin[i]
		if (i + 1) <= r {
			arrMax[i] = 2 * arrMax[i-1]
		} else {
			arrMax[i] = arrMax[i-1]
		}
		max += arrMax[i]
	}
	fmt.Println(min, max)
}


package main

import (
	"fmt"
	"math"
)

func main() {
	var n, l, r int
	fmt.Scan(&n)
	fmt.Scan(&l)
	fmt.Scan(&r)
	fmt.Print(int(math.Pow(2, float64(l))-1)+(n-l), " ", int(math.Pow(2, float64(r))-1)+(n-r)*int(math.Pow(2, float64(r-1))))
}


package main

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

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	n, l, r := int64(0), int64(0), int64(0)
	fmt.Fscanf(in, "%d %d %d\n", &n, &l, &r)
	min := int64(0)
	a := make([]int64, n)
	a[0] = 1
	// min
	cur := int64(1)
	for i := int64(0); i < l; i++ {
		min += cur
		cur *= 2
		//fmt.Println(min)
	}
	min = min + (n - l) //all ones
	// max
	max := int64(0)
	cur = int64(1)
	for i := int64(0); i < r; i++ {
		max += cur
		cur *= 2
		//fmt.Println(max)
	}
	cur /= 2
	for i := r; i < n; i++ {
		max += cur
	}
	fmt.Fprintf(out, "%d %d\n", min, max)
	return
}
func minstep(a, b byte) int {
	return min(int(a-b+26)%26, int(b-a+26)%26)
}

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


package main

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

var scanner *bufio.Scanner

func getI64() int64 {
  scanner.Scan()
  x, _ := strconv.ParseInt(scanner.Text(), 10, 64)
  return x
}
func getI() int {
  return int(getI64())
}
func getF() float64 {
  scanner.Scan()
  x, _ := strconv.ParseFloat(scanner.Text(), 64)
  return x
}
func getS() string {
  scanner.Scan()
  return scanner.Text()
}

func main() {
  scanner = bufio.NewScanner(os.Stdin)
  scanner.Split(bufio.ScanWords)
  writer := bufio.NewWriter(os.Stdout)
  defer writer.Flush()

  value := map[byte]int{ '>': 8, '<': 9, '+': 10, '-': 11,
                         '.': 12, ',': 13, '[': 14, ']': 15 }
  mod := 1000*1000+3
  p := getS()
  total := 0
  for i := 0; i < len(p); i++ {
    v := value[p[i]]
    total = (16*total + v) % mod
  }
  writer.WriteString(fmt.Sprintf("%d\n", total))
}


package main

import (
  "fmt"
  // "strings"
)

var n int
var str string
func main() {
	fmt.Scanf("%d\n", &n)
	fmt.Scanf("%s", &str)
	strr := []rune(str)
	pos := 0
	for pos < len(strr)-1 {
	    if (strr[pos] == 85 && strr[pos+1] == 82) || (strr[pos] == 82 && strr[pos+1] == 85){
  	    strr[pos]=68
	      if pos+2 > len(strr){
	        strr = strr[:pos+1]
	      } else {
	        strr = append(strr[:pos+1], strr[pos+2:]...)
	      }
	    }
	    pos += 1
	}
	fmt.Println(len(strr))
}


package main

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

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

// 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
}

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

// Read next line as []byte
func readbln() []byte {
	b, err := nextLine()
	if err != nil {
		panic(err)
	}
	return 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...)
}

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

// 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 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 abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

func absll(a int64) int64 {
	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)
}

func main() {
	defer Flush()

	n := readi()
	s := readb()

	var t []byte
	t = append(t, s[0])
	for i := 1; i < n; i++ {
		j := len(t) - 1
		if t[j] != 'D' && s[i] != t[j] {
			t[j] = 'D'
		} else {
			t = append(t, s[i])
		}
	}
	println(len(t))
}


package main

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

func Init() {
}

func Solve(io *FastIO) {
	N := io.NextInt()
	S := io.NextString()

	ans := 0
	idx := 0
	for idx < N {
	  if idx + 1 < N && S[idx] != S[idx + 1] {
	    idx += 2
	  } else {
	    idx++
	  }
	  ans++
	}
	io.Println(ans)
}

type FastIO struct {
	reader *bufio.Reader
	writer *bufio.Writer
}

func (io *FastIO) NextChar() byte {
	c, _ := io.reader.ReadByte()
	return c
}

func (io *FastIO) NextInt() int {
	c := io.NextChar()
	for IsSpaceChar(c) {
		c = io.NextChar()
	}
	sgn := 1
	if c == '-' {
		sgn = -1
		c = io.NextChar()
	}
	res := 0
	for !IsSpaceChar(c) {
		res = (res * 10) + int(c - '0')
		c = io.NextChar()
	}
	return sgn * res
}

func (io *FastIO) NextLong() int64 {
	c := io.NextChar()
	for IsSpaceChar(c) {
		c = io.NextChar()
	}
	sgn := int64(1)
	if c == '-' {
		sgn = -1
		c = io.NextChar()
	}
	res := int64(0)
	for !IsSpaceChar(c) {
		res = (res * 10) + int64(c - '0')
		c = io.NextChar()
	}
	return sgn * res
}

func (io *FastIO) NextIntArray(size int) []int {
	return io.NextIntArrayOffset(size, 0)
}

func (io *FastIO) NextIntArrayOffset(size, offset int) []int {
	arr := make([]int, size + offset)
	for i := 0; i < size; i++ {
		arr[i + offset] = io.NextInt()
	}
	return arr
}

func (io *FastIO) NextLongArray(size int) []int64 {
	return io.NextLongArrayOffset(size, 0)
}

func (io *FastIO) NextLongArrayOffset(size, offset int) []int64 {
	arr := make([]int64, size + offset)
	for i := 0; i < size; i++ {
		arr[i + offset] = io.NextLong()
	}
	return arr
}

func (io *FastIO) NextString() string {
	c := io.NextChar()
	for (IsSpaceChar(c)) {
		c = io.NextChar()
	}
	var sb bytes.Buffer
	for !IsSpaceChar(c) {
		sb.WriteByte(c)
		c = io.NextChar()
	}
	return sb.String()
}

func (io *FastIO) NextLine() string {
	c := io.NextChar()
	for (IsSpaceChar(c)) {
		c = io.NextChar()
	}
	var sb bytes.Buffer
	for !IsLineBreakChar(c) {
		sb.WriteByte(c)
		c = io.NextChar()
	}
	return sb.String()
}

func (io *FastIO) Println(args ...interface{}) {
	io.writer.WriteString(fmt.Sprintln(args...))
}

func (io *FastIO) Printf(format string, args ...interface{}) {
	io.writer.WriteString(fmt.Sprintf(format, args...))
}

func (io *FastIO) FlushOutput() {
	io.writer.Flush()
}

func IsSpaceChar(c byte) bool {
	switch c {
	case 0, '\t', '\n', '\r', ' ':
		return true
	default:
		return false
	}
}

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

func main() {
	io := FastIO{reader: bufio.NewReader(os.Stdin), writer: bufio.NewWriter(os.Stdout)}
	Init()
	Solve(&io)
	io.FlushOutput()
}


package main

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

func main() {
	var n, m, r, s int64
	var err error
	reader := bufio.NewReaderSize(os.Stdin, 1024*1024)

	st := strings.Split(readLine(reader), " ")

	n, err = strconv.ParseInt(st[0], 10, 64)
	if err != nil {
		panic(err)
	}

	m, err = strconv.ParseInt(st[1], 10, 64)
	if err != nil {
		panic(err)
	}

	r, err = strconv.ParseInt(st[2], 10, 64)
	if err != nil {
		panic(err)
	}

	var nr, mr []int64

	arTemp := strings.Split(readLine(reader), " ")

	for arItr := int64(0); arItr < n; arItr++ {
		temp, err := strconv.ParseInt(arTemp[arItr], 10, 64)
		if err != nil {
			panic(err)
		}
		nr = append(nr, temp)
	}
	arTemp = strings.Split(readLine(reader), " ")

	for arItr := int64(0); arItr < m; arItr++ {
		temp, err := strconv.ParseInt(arTemp[arItr], 10, 64)
		if err != nil {
			panic(err)
		}
		mr = append(mr, temp)
	}

	sort.Slice(nr, func(i, j int) bool { return nr[j] > nr[i] })
	sort.Slice(mr, func(i, j int) bool { return mr[j] > mr[i] })

	if nr[0] >= mr[len(mr)-1] || r < nr[0] {
		fmt.Print(r)
		return
	}

	for _, v := range nr {
		if r >= v {
			s += r / v
			t := r / v
			r -= t * v
		} else {
			break
		}
	}
	r += mr[len(mr)-1] * s
	fmt.Print(r)
	return
}

func readLine(reader *bufio.Reader) string {
	str, _, err := reader.ReadLine()
	if err == io.EOF {
		return ""
	}

	return strings.TrimRight(string(str), "\r\n")
}


package main

import "fmt"

func min(a,b int) int  {
	if(a < b){
		return a
		}
	return b
}
func katta(a,b int) int  {
	if(a < b){
		return b
	}
	return a
}
func ab(x int) int {
	if(x <= -1){
		x *= -1
	}
	return x
}
//a b c d e f g h j k l m n o p q r s t u v w x y z
func calc(s string) (res int) {

	res += min(ab(int(s[0]) - int('A')) ,ab(int('Z') - int(s[0])) + 1)
	res += min(ab(int(s[1]) - int('C')),ab(int('Z') - int(s[1])) + 3)
	res += min(ab(int(s[2])- int('T')),min(ab(int('Z') - int(s[2])) + 20,ab(int('A') - int(s[2]))+7))
	res += min(ab(int(s[3])- int('G')),ab(int('Z') - int(s[3])) + 7)
	return
}

func main()  {
	var n , m ,r int
	fmt.Scanf("%d %d %d",&n,&m,&r)
	maxe := 0
	mine := 1001
	var x int
	for i := 0 ; i < n;i++{
		fmt.Scan(&x)
		if(x < mine){
			mine = x
		}
	}
	for i := 0 ; i< m ;i ++{
		fmt.Scan(&x)
		if(x > maxe){
			maxe = x
		}
	}
	fmt.Println(katta(((r/mine) * maxe) + r % mine,r))

}


// Author: sighduck
// URL: https://codeforces.com/contest/1150/problem/A

package main

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

func min(a []int) int {
	minElem := a[0]
	for i := 1; i < len(a); i++ {
		if a[i] < minElem {
			minElem = a[i]
		}
	}
	return minElem
}

func max(a []int) int {
	maxElem := a[0]
	for i := 1; i < len(a); i++ {
		if a[i] > maxElem {
			maxElem = a[i]
		}
	}
	return maxElem
}

func Solve(n int, m int, r int, s []int, b[]int) int {
	minBuyPrice := min(s)
	maxSellPrice := max(b)
	if maxSellPrice > minBuyPrice {
		shares := r / minBuyPrice
		remainder := r % minBuyPrice
		return shares * maxSellPrice + remainder
	}
	return r
}

func main() {
	reader := bufio.NewReader(os.Stdin)
	writer := bufio.NewWriter(os.Stdout)
	defer writer.Flush()

	var n, m, r int
	fmt.Fscanf(reader, "%d %d %d\n", &n, &m, &r)
	s := make([]int, n)
	for i := 0; i < n; i++ {
		fmt.Fscan(reader, &s[i])
	}
	b := make([]int, m)
	for i := 0; i < m; i++ {
		fmt.Fscan(reader, &b[i])
	}

	fmt.Fprintf(writer, "%d\n", Solve(n, m, r, s, b))
}


// B. Internet Address
/*
Vasya is an active Internet user. One day he came across an Internet resource he liked, so he wrote its address in the notebook. We know that the address of the written resource has format:
			<protocol>://<domain>.ru[/<context>]

where:

    <protocol> can equal either "http" (without the quotes) or "ftp" (without the quotes),
    <domain> is a non-empty string, consisting of lowercase English letters,
	 	the /<context> part may not be present. If it is present, then <context> is a non-empty string, consisting of lowercase English letters.

If string <context> isn't present in the address, then the additional character "/" isn't written. Thus, the address has either two characters "/" (the ones that go before the domain), or three (an extra one in front of the context).

When the boy came home, he found out that the address he wrote in his notebook had no punctuation marks. Vasya must have been in a lot of hurry and didn't write characters ":", "/", ".".

Help Vasya to restore the possible address of the recorded Internet resource.

Input
The first line contains a non-empty string that Vasya wrote out in his notebook. This line consists of lowercase English letters only.

It is guaranteed that the given string contains at most 50 letters. It is guaranteed that the given string can be obtained from some correct Internet resource address, described above.

Output
Print a single line — the address of the Internet resource that Vasya liked. If there are several addresses that meet the problem limitations, you are allowed to print any of them.

Examples
Input
httpsunrux

Output
http://sun.ru/x

Input
ftphttprururu

Output
ftp://http.ru/ruru

Note
In the second sample there are two more possible answers: "ftp://httpruru.ru" and "ftp://httpru.ru/ru".
*/
package main

import (
	"bufio"
	"fmt"
	"os"
	"strings"
)

func main() {
	reader := bufio.NewReader(os.Stdin)
	s, _ := reader.ReadString('\n')
	s = strings.TrimSpace(s)

	pIndex := 3
	url := "ftp://"
	if s[0] == 'h' {
		pIndex = 4
		url = "http://"
	}

	cIndex := len(s)
	for i := pIndex + 1; i < len(s)-1; i++ {
		if s[i] == 'r' && s[i+1] == 'u' {
			cIndex = i
			break
		}
	}

	if cIndex < len(s)-2 {
		fmt.Printf("%v%v.ru/%v", url, s[pIndex:cIndex], s[cIndex+2:])
	} else {

		fmt.Printf("%v%v.ru", url, s[pIndex:cIndex])
	}
}


// B. Internet Address
/*
Vasya is an active Internet user. One day he came across an Internet resource he liked, so he wrote its address in the notebook. We know that the address of the written resource has format:
			<protocol>://<domain>.ru[/<context>]

where:

    <protocol> can equal either "http" (without the quotes) or "ftp" (without the quotes),
    <domain> is a non-empty string, consisting of lowercase English letters,
	 	the /<context> part may not be present. If it is present, then <context> is a non-empty string, consisting of lowercase English letters.

If string <context> isn't present in the address, then the additional character "/" isn't written. Thus, the address has either two characters "/" (the ones that go before the domain), or three (an extra one in front of the context).

When the boy came home, he found out that the address he wrote in his notebook had no punctuation marks. Vasya must have been in a lot of hurry and didn't write characters ":", "/", ".".

Help Vasya to restore the possible address of the recorded Internet resource.

Input
The first line contains a non-empty string that Vasya wrote out in his notebook. This line consists of lowercase English letters only.

It is guaranteed that the given string contains at most 50 letters. It is guaranteed that the given string can be obtained from some correct Internet resource address, described above.

Output
Print a single line — the address of the Internet resource that Vasya liked. If there are several addresses that meet the problem limitations, you are allowed to print any of them.

Examples
Input
httpsunrux

Output
http://sun.ru/x

Input
ftphttprururu

Output
ftp://http.ru/ruru

Note
In the second sample there are two more possible answers: "ftp://httpruru.ru" and "ftp://httpru.ru/ru".
*/
package main

import (
	"bufio"
	"fmt"
	"os"
	"strings"
)

func main() {
	reader := bufio.NewReader(os.Stdin)
	s, _ := reader.ReadString('\n')
	arr := strings.Split(strings.TrimSpace(s), "")

	pIndex := 3
	url := "ftp://"
	if arr[0] == "h" {
		pIndex = 4
		url = "http://"
	}

	cIndex := len(arr)
	for i := pIndex + 1; i < len(arr)-1; i++ {
		if arr[i] == "r" && arr[i+1] == "u" {
			cIndex = i
			break
		}
	}
	if cIndex < len(arr)-2 {
		fmt.Printf("%v%v.ru/%v", url, strings.Join(arr[pIndex:cIndex], ""), strings.Join(arr[cIndex+2:], ""))
	} else {

		fmt.Printf("%v%v.ru", url, strings.Join(arr[pIndex:cIndex], ""))
	}
}


package main

import "fmt"

func main() {
    var s string
    fmt.Scan(&s)
    in := 0
    for {
        fmt.Print(string(s[in]))
        in++
        if (s[in-1] == 'p') { break }
    }
    fmt.Print("://")
    for {
        fmt.Print(string(s[in]))
        in++
        if (s[in] == 'r') && (s[in+1] == 'u') {
            fmt.Print(".ru")
            in += 2
            break
        }
    }
    if in < len(s) { fmt.Print("/") }
    for ; in < len(s); in++ {
        fmt.Print(string(s[in]))
    }
    fmt.Println()
}


package main
import (
	"fmt"
	//"bufio"
	//"os"
	//"strconv"
)
var a [20]int
func check(x int) int{
	for i:=1;x>0;i++ {
		if a[x%10]!=0 {
			return 1
		}
		x/=10
	}
	return 0
}
func main() {
	var n, ans int
	fmt.Scan(&n)
	for i:=n;i>0;i/=10 {
		a[i%10]=1
	}
	for i:=1; i*i<=n;i++ {
		if n%i==0 {
			ans += check(i)
			if i*i!=n {
				ans+=check(n/i)
			}
		}
	}
	fmt.Println(ans)
}


package main

import (
	"fmt"
)

func get_digits(n int) []bool {
	output := make([]bool, 10)
	for n > 0 {
		output[n%10] = true
		n = n/10
	}
	return output
}

func compatible(digits []bool, n int) bool {
	for n > 0 {
		if digits[n%10] {
			return true
		}
		n = n/10
	}
	return false
}

func main() {
	var input int
	fmt.Scan(&input)
	digits := get_digits(input)
	ans := 0
	for i:=1; i*i<=input; i++ {
		if input%i == 0 {
			if compatible(digits, i) {ans++}
			if i*i != input && compatible(digits, input/i) {ans++}
		}
	}
	fmt.Println(ans)
}


package main

import "fmt"

func main() {
    var x int
    var d [10]bool

    check := func(a int) bool {
        for ; a != 0; a /= 10 {
            if d[a%10] { return true }
        }
        return false
    }

    fmt.Scan(&x)
    for a := x; a != 0; a /= 10 {
        d[a%10] = true
    }
    ans := 0
    for i := 1; i*i <= x; i++ {
        if (x%i) == 0 {
            if check(i) { ans++ }
            if (i != x/i) && check(x/i) { ans++ }
        }
    }
    fmt.Println(ans)
}


package main

import (
	"fmt"
)

func isValid(nums []int, start, end int) bool {
	return (start-end)%2 == 0 && nums[start]%2 == 1 && nums[end]%2 == 1
}

func main() {
	var t int
	fmt.Scanf("%d\n", &t)

	nums := make([]int, t)
	for i := 0; i < t; i++ {
		fmt.Scanf("%d", &nums[i])
	}

	if isValid(nums, 0, len(nums)-1) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}


package main

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

func main() {
	sc := NewScanner()
	N := sc.NextInt()
	A := sc.NextIntArray()
	if N%2 == 0 {
		fmt.Println("NO")
		return
	}
	if A[0]%2 == 1 && A[N-1]%2 == 1 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}

}

type Scanner struct {
	r   *bufio.Reader
	buf []byte
	p   int
}

func NewScanner() *Scanner {
	rdr := bufio.NewReaderSize(os.Stdin, 1000)
	return &Scanner{r: rdr}
}
func (s *Scanner) Next() string {
	s.pre()
	start := s.p
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			break
		}
	}
	result := string(s.buf[start:s.p])
	s.p++
	return result
}
func (s *Scanner) NextLine() string {
	s.pre()
	start := s.p
	s.p = len(s.buf)
	return string(s.buf[start:])
}
func (s *Scanner) NextInt() int {
	v, _ := strconv.Atoi(s.Next())
	return v
}
func (s *Scanner) NextInt64() int64 {
	v, _ := strconv.ParseInt(s.Next(), 10, 64)
	return v
}

func (s *Scanner) NextIntArray() []int {
	s.pre()
	start := s.p
	result := []int{}
	for ; s.p < len(s.buf)+1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)
			result = append(result, int(v))
			start = s.p + 1
		}
	}

	return result
}
func (s *Scanner) NextInt64Array() []int64 {
	s.pre()
	start := s.p
	result := []int64{}
	for ; s.p < len(s.buf)+1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)
			result = append(result, v)
			start = s.p + 1
		}
	}
	return result
}

func (s *Scanner) NextMap() map[int]bool {
	s.pre()
	start := s.p
	mp := map[int]bool{}
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			v, _ := strconv.Atoi(string(s.buf[start:s.p]))
			mp[v] = true
			start = s.p + 1
		}
	}
	v, _ := strconv.Atoi(string(s.buf[start:s.p]))
	mp[v] = true

	return mp
}

func (s *Scanner) pre() {
	if s.p >= len(s.buf) {
		s.readLine()
		s.p = 0
	}
}
func (s *Scanner) readLine() {
	s.buf = make([]byte, 0)
	for {
		l, p, e := s.r.ReadLine()
		if e != nil {
			panic(e)
		}
		s.buf = append(s.buf, l...)
		if !p {
			break
		}
	}
}


package main

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

const (
	SCANNER_BUF_SIZE = 2 << 20

	INF = int64(math.MaxInt64)
	MOD = 1e9 + 7
)

var (
	writer  *bufio.Writer
	scanner *bufio.Scanner
)

func init() {
	writer = bufio.NewWriter(os.Stdout)
	scanner = bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, SCANNER_BUF_SIZE), SCANNER_BUF_SIZE)
}

func printf(f string, a ...interface{}) {
	fmt.Fprintf(writer, f, a...)
}

func sint64() int64 {
	scanner.Scan()
	bb := scanner.Bytes()
	i := int64(0)
	if bb[0] == '-' {
		for _, b := range bb[1:] {
			i *= 10
			i -= int64(b - '0')
		}
		return i
	}
	for _, b := range bb {
		i *= 10
		i += int64(b - '0')
	}
	return i
}

func suint64() uint64 {
	scanner.Scan()
	bb := scanner.Bytes()
	i := uint64(0)
	for _, b := range bb {
		i *= 10
		i += uint64(b - '0')
	}
	return i
}

func sstring() string {
	scanner.Scan()
	return scanner.Text()
}

func gcd(a, b int64) int64 {
	for b != 0 {
		a, b = b, a%b
	}
	return a
}

func lcm(a, b int64) int64 {
	return a * b / gcd(a, b)
}

func abs(a int64) int64 {
	if a < 0 {
		return a * -1
	}
	return a
}

func min(a int64, rest ...int64) int64 {
	for _, r := range rest {
		if r < a {
			a = r
		}
	}
	return a
}

func max(a int64, rest ...int64) int64 {
	for _, r := range rest {
		if r > a {
			a = r
		}
	}
	return a
}

func main() {
	defer writer.Flush()
	n := sint64()
	a := make([]int64, n)
	for i := range a {
		a[i] = sint64()
	}
	printf("%s\n", sol(a))
}

func sol(a []int64) string {
	if len(a) & 1 == 1 && a[0] & 1 == 1 && a[len(a)-1] & 1 == 1 {
		return "Yes"
	}
	return "No"
}


package main

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

func main() {
	defer out.Flush()

	n := ScanInt()
	a := ScanInts(n)
	P(solv(n, a))

}

func solv(n int, a []int) int {
	dp := make([][]int, n+1)
	for i := 0; i <= n; i++ {
		dp[i] = make([]int, 4)
	}
	// j
	// 0 = rest
	// 1 = write
	// 2= gym

	// a[i]
	// 0 >> no gym && no write
	// 1 >> no gym &&    write
	// 2 >>    gym && no write
	// 3 >>    gym && 	 write
	for i := 1; i <= n; i++ {
		dp[i][0] = Mx(dp[i-1][0], dp[i-1][1], dp[i-1][2])

		if a[i-1] == 1 || a[i-1] == 3 {
			dp[i][1] = Mx(dp[i-1][2], dp[i-1][0]) + 1
		}
		if a[i-1] == 2 || a[i-1] == 3 {
			dp[i][2] = Mx(dp[i-1][0], dp[i-1][1]) + 1
		}
	}

	return n - Mx(dp[n][0], dp[n][1], dp[n][2])
}

/*********************** I/O ***********************/
var in *bufio.Scanner
var out *bufio.Writer

func init() {
	in = bufio.NewScanner(os.Stdin)
	in.Buffer(make([]byte, 1024), int(1e+9))
	in.Split(bufio.ScanWords)
	out = bufio.NewWriter(os.Stdout)
}

func P(args ...interface{}) {
	print("\n", args...)
}

func PS(args ...interface{}) {
	print(" ", args...)
	print("\n", nil)
}

func print(seperator string, args ...interface{}) {
	for _, arg := range args {
		str := ""
		switch v := arg.(type) {
		case byte:
			str = string(v)
		case rune:
			str = string(v)
		case int:
			str = strconv.Itoa(v)
		case []int:
			sb := strings.Builder{}
			for i := 0; i < len(v); i++ {
				sb.WriteString(strconv.Itoa(v[i]) + " ")
			}
			str = sb.String()
		case int64:
			str = strconv.FormatInt(v, 10)
		case []int64:
			sb := strings.Builder{}
			for i := 0; i < len(v); i++ {
				sb.WriteString(strconv.FormatInt(v[i], 10) + " ")
			}
			str = sb.String()
		case string:
			str = v
		default:
			panic("invalid print arg: " + fmt.Sprintf("%v", arg))

		}
		out.WriteString(str + seperator)
	}
}

func ScanWord() string { in.Scan(); return in.Text() }
func ScanWords(n int) []string {
	s := make([]string, n)
	for i := 0; i < n; i++ {
		s[i] = ScanWord()
	}
	return s
}
func ScanInt() int { i, _ := strconv.Atoi(ScanWord()); return i }
func ScanInts(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = ScanInt()
	}
	return a
}

func MnMx(args ...int) (int, int) {
	minVal, maxVal := math.MaxInt32, math.MinInt32
	for _, v := range args {
		if v < minVal {
			minVal = v
		}
		if v > maxVal {
			maxVal = v
		}
	}
	return minVal, maxVal
}
func Mn(args ...int) int { mn, _ := MnMx(args...); return mn }
func Mx(args ...int) int { _, mx := MnMx(args...); return mx }
func LCM(a, b int) int   { return a / GCD(a, b) * b }
func GCD(a, b int) int {
	if a == 0 {
		return b
	}
	return GCD(b%a, a)
}
func Abs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}


package main

import (
	"bufio"
	"fmt"
	"os"
	"unicode"
)

var stdReader *bufio.Reader = bufio.NewReader(os.Stdin)

func readInt() (result int) {
	var negative, started bool
READER_LOOP:
	for {
		char, err := stdReader.ReadByte()
		switch {
		case err != nil:
			break READER_LOOP
		case char == '-':
			negative = true
		case unicode.IsDigit(rune(char)):
			started = true
			result = result*10 + int(char&0xf)
		case started:
			break READER_LOOP
		}
	}
	if negative {
		result = -result
	}
	return
}

func main() {
	n := readInt()

	// dp[][0] - Vasya rested
	// dp[][1] - Vasya wrote contest
	// dp[][2] - Vasya practiced in a gym
	dp := make([][3]int, n+1)
	for i := 1; i <= n; i++ {
		// dp[i][0]
		dp[i][0] = dp[i-1][0]
		if dp[i-1][1] > dp[i][0] {
			dp[i][0] = dp[i-1][1]
		}
		if dp[i-1][2] > dp[i][0] {
			dp[i][0] = dp[i-1][2]
		}

		input := readInt()
		// dp[i][1]
		if input == 1 || input == 3 {
			dp[i][1] = dp[i-1][0] + 1
			if dp[i-1][2]+1 > dp[i][1] {
				dp[i][1] = dp[i-1][2] + 1
			}
		}

		// dp[i][2]
		if input == 2 || input == 3 {
			dp[i][2] = dp[i-1][0] + 1
			if dp[i-1][1]+1 > dp[i][2] {
				dp[i][2] = dp[i-1][1] + 1
			}
		}
	}

	answer := dp[n][0]
	if dp[n][1] > answer {
		answer = dp[n][1]
	}
	if dp[n][2] > answer {
		answer = dp[n][2]
	}
	fmt.Println(n - answer)
}


package main

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

var (
	reader  = bufio.NewReader(os.Stdin)
	writer  = bufio.NewWriter(os.Stdout)
	scanner = bufio.NewScanner(os.Stdin)
)

//Wrong
func main() {
	defer writer.Flush()
	scanner.Split(bufio.ScanWords)

	n, m := nextInt(), nextInt()

	a := make([]int, n)
	permutations := make([][]int, 0, 10)
	maxP := 0
	minP := 0

	if n == 1 {
		println(1)
		return
	}

	for i := range a {
		a[i] = i+1
	}

	for i := n-1; i > 0; {
		minP = sumMin(a)
		if maxP < minP {
			maxP = minP
			permutations = make([][]int, 0, 10)
		}

		if maxP <= minP {
			b := make([]int, n)
			copy(b, a)
			permutations = append(permutations, b)
		}
		// println(a, minP, maxP, permutations)

		i = n-1

		for ; i > 0; i-- {
			if a[i] > a[i-1] {
				sort.Ints(a[i:])

				for j := i; j < n; j++ {
					if a[i-1] < a[j] {
						a[i-1], a[j] = a[j], a[i-1]
						break
					}
				}

				break
			}
		}

	}

	// println(a, permutations)
	for i := range a {
		printf("%d ", permutations[m-1][i])
	}

	println()
}

func sumMin(a []int) int {
	sum := 0

	for i := range a {
		for j := i; j < len(a); j++ {
			sum += min(a[i:j+1]...)
		}
	}

	return sum
}

func min(a ...int) int {
	min := math.MaxInt32

	if a != nil {
		for i := range a {
			if min > a[i] {
				min = a[i]
			}
		}
	}

	return min
}

func scan(a ...interface{}) {
	fmt.Fscan(reader, a...)
}

func next() string {
	if !scanner.Scan() {
		panic("Scan error")
	}
	return scanner.Text()
}

func nextInt() int {
	n, _ := strconv.Atoi(next())
	return n
}

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

func println(a ...interface{}) {
	fmt.Fprintln(writer, a...)
}

func printf(format string, a ...interface{}) {
	fmt.Fprintf(writer, format, a...)
}


package main

import (
    "strconv"
    "bufio"
    "os"
    "fmt"
)
// var file, _ = os.Open("input.txt")
// var outfile, _ = os.Create("output.txt")
// var in = bufio.NewScanner(file)
// var out = bufio.NewWriter(outfile)
var in = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriter(os.Stdout)

func next() string {
    if !in.Scan() {
        panic("Scan error")
    }
    return in.Text()
}

func nextInt() int {
    ret, _ := strconv.Atoi(next())
    return ret
}

func nextInt64() int64 {
    ret, _ := strconv.ParseInt(next(), 10, 64)
    return ret
}

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

func swap(a []int, i int, j int) {
    a[i], a[j] = a[j], a[i]
}

func reverse(a []int, i int, j int) {
    for i < j {
        swap(a, i, j)
        i++
        j--
    }
}

func nextPermutation(a []int) bool {
    k := len(a) - 2
    for k > -1 && a[k] > a[k + 1] { k-- }
    if k == -1 { return false }
    l := len(a) - 1
    for k < l && a[k] > a[l] { l-- }
    swap(a, k, l)
    reverse(a, k + 1, len(a) - 1)
    return true
}

func f(a []int) int {
    n := len(a)
    sum := 0
    for i := 0; i < n; i++ {
        for j := i; j < n; j++ {
            min := -1;
            for k := i; k <= j; k++ {
                if min == -1 || min > a[k] {
                    min = a[k]
                }
            }
            sum += min
        }
    }
    return sum
}

func main() {
    defer out.Flush()
    in.Split(bufio.ScanWords)
    n := nextInt()
    m := nextInt()
    a := make([]int, n)
    for i := 0; i < n; i++ {
        a[i] = i + 1
    }
    ms := f(a)
    for nextPermutation(a) {
        sum := f(a)
        if ms < sum { ms = sum }
    }
    for i := 0; i < n; i++ {
        a[i] = i + 1
    }
    if ms == f(a) {
        m--
    }
    if m == 0 {
        for i := 0; i < n; i++ {
            fmt.Fprint(out, strconv.Itoa(a[i]) + " ")
        }
        fmt.Fprintln(out)
        return
    }
    for nextPermutation(a) {
        sum := f(a)
        if ms == sum {
            m--
            if m == 0 {
                for i := 0; i < n; i++ {
                    fmt.Fprint(out, strconv.Itoa(a[i]) + " ")
                }
                fmt.Fprintln(out)
                return
            }
        }
    }
}


package main

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

var scanner *bufio.Scanner
var writer *bufio.Writer

func getI64() int64 {
  scanner.Scan()
  x, _ := strconv.ParseInt(scanner.Text(), 10, 64)
  return x
}
func getI() int {
  return int(getI64())
}
func getF() float64 {
  scanner.Scan()
  x, _ := strconv.ParseFloat(scanner.Text(), 64)
  return x
}
func getS() string {
  scanner.Scan()
  return scanner.Text()
}

func main() {
  scanner = bufio.NewScanner(os.Stdin)
  scanner.Split(bufio.ScanWords)
  writer = bufio.NewWriter(os.Stdout)
  defer writer.Flush()

  a, b := getI(), getI()
  t, d := getI(), getI()
  result := a + b
  x := a
  for i := 2; i < t; i++ {
    x += d
    result += x
  }
  excess := x-b-d
  for excess > 0 {
    result -= excess
    if excess < 2*d {
      excess = 0
    } else {
      excess -= 2*d
    }
  }
  writer.WriteString(fmt.Sprintf("%d\n", result))
}


package main

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

const (
	MAX_T = 110
)

var v1, v2 int
var T, D int
var dp [MAX_T][MAX_T * 10]int
var visited [MAX_T][MAX_T * 10]bool

func init() {
	for i := 0; i < MAX_T; i++ {
		for j := 0; j < len(dp[i]); j++ {
			dp[i][j] = -1
		}
	}
}

func memo(t, v int) int {
	if t == T {
		if v == v2 {
			return 0
		}
		return -1145141919
	}
	if visited[t][v] {
		return dp[t][v]
	}
	visited[t][v] = true
	res := -1145141919
	res = IntMax(res, memo(t+1, v)+v)
	for i := 1; i <= D; i++ {
		res = IntMax(res, memo(t+1, v+i)+v+i)
		if v-i >= 0 {
			res = IntMax(res, memo(t+1, v-i)+v-i)
		}
	}
	dp[t][v] = res
	return res
}

func main() {
	fsc := NewFastScanner()
	v1, v2 = fsc.NextInt(), fsc.NextInt()
	T, D = fsc.NextInt(), fsc.NextInt()
	fmt.Println(memo(1, v1) + v1)
}

//template
type FastScanner struct {
	r   *bufio.Reader
	buf []byte
	p   int
}

func NewFastScanner() *FastScanner {
	rdr := bufio.NewReaderSize(os.Stdin, 1024)
	return &FastScanner{r: rdr}
}
func (s *FastScanner) Next() string {
	s.pre()
	start := s.p
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			break
		}
	}
	result := string(s.buf[start:s.p])
	s.p++
	return result
}
func (s *FastScanner) NextLine() string {
	s.pre()
	start := s.p
	s.p = len(s.buf)
	return string(s.buf[start:])
}
func (s *FastScanner) NextInt() int {
	v, _ := strconv.Atoi(s.Next())
	return v
}
func (s *FastScanner) NextInt64() int64 {
	v, _ := strconv.ParseInt(s.Next(), 10, 64)
	return v
}

func (s *FastScanner) pre() {
	if s.p >= len(s.buf) {
		s.readLine()
		s.p = 0
	}
}
func (s *FastScanner) readLine() {
	s.buf = make([]byte, 0)
	for {
		l, p, e := s.r.ReadLine()
		if e != nil {
			panic(e)
		}
		s.buf = append(s.buf, l...)
		if !p {
			break
		}
	}
}

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

func Int64Max(a, b int64) int64 {
	if a < b {
		return b
	}
	return a
}
func Float64Max(a, b float64) float64 {
	if a < b {
		return b
	}
	return a
}

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

func Int64Min(a, b int64) int64 {
	if a > b {
		return b
	}
	return a
}
func Float64Min(a, b float64) float64 {
	if a > b {
		return b
	}
	return a
}

//Gcd
func IntGcd(a, b int) int {
	if a < b {
		b, a = a, b
	}
	if b == 0 {
		return a
	}
	return IntGcd(b, a%b)
}
func Int64Gcd(a, b int64) int64 {
	if a < b {
		b, a = a, b
	}
	if b == 0 {
		return a
	}
	return Int64Gcd(b, a%b)
}


package main

import (
	"fmt"
)

func int_abs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}

func int_max(x, y int) int {
	if x > y {
		return x
	}
	return y
}

func int_min(x, y int) int {
	if x < y {
		return x
	}
	return y
}

func main() {
	var v1, v2, t, d int
	fmt.Scan(&v1)
	fmt.Scan(&v2)
	fmt.Scan(&t)
	fmt.Scan(&d)
	ans := 0
	speed := v1
	for i := 0; i < t; i++ {
		ans += speed
		speed = int_min(speed+d, v2+d*(t-2-i))
	}
	fmt.Println(ans)
}


package main

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

type graph struct {
	size   int
	edges  [][]bool
	degree []int
	color  []int
}

func (g *graph) add(from, to int) {
	g.edges[from][to] = true
	g.degree[from]++
}

func (g *graph) addBoth(from, to int) {
	g.add(from, to)
	if from != to {
		g.add(to, from)
	}
}

func (g *graph) _isBipartite(v int) bool {
	for w, e := range g.edges[v] {
		if e || w == v {
			continue
		}
		if g.color[w] == g.color[v] {
			return false
		}
		if g.color[w] == 0 {
			g.color[w] = 3 - g.color[v]
			if !g._isBipartite(w) {
				return false
			}
		}
	}
	return true
}

func (g *graph) isBipartite() bool {
	checked := false
	cnt := 0
	for i, deg := range g.degree {
		deg = g.size - 1 - deg
		if deg > 0 {
			if checked {
				if g.color[i] == 0 {
					return false
				}
				continue
			}
			g.color[i] = 1
			if !g._isBipartite(i) {
				return false
			}
			for w := range g.edges[i] {
				if g.color[w] == 2 {
					cnt++
				}
			}
			checked = true
		}
	}
	if cnt > 0 {
		for v, c := range g.color {
			if c == 1 {
				cntW := 0
				for w, e := range g.edges[v] {
					if e || w == v {
						continue
					}
					if g.color[w] == 2 {
						cntW++
					}
				}
				if cntW != cnt {
					return false
				}
			}
		}
	}
	return true
}

// github.com/EndlessCheng/codeforces-go
func Sol623A(reader io.Reader, writer io.Writer) {
	in := bufio.NewReader(reader)
	out := bufio.NewWriter(writer)
	defer out.Flush()

	var n, m int
	Fscan(in, &n, &m)
	g := &graph{
		size:   n,
		edges:  make([][]bool, n),
		degree: make([]int, n),
		color:  make([]int, n),
	}
	for i := range g.edges {
		g.edges[i] = make([]bool, n)
	}
	for ; m > 0; m-- {
		var v, w int
		Fscan(in, &v, &w)
		g.addBoth(v-1, w-1)
	}

	// 若反图为空或二分图，则存在
	if !g.isBipartite() {
		Fprint(out, "No")
		return
	}

	Fprintln(out, "Yes")
	for _, c := range g.color {
		Fprintf(out, "%c", "bac"[c])
	}
}

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


package main

import (
    "strconv"
    "bufio"
    "os"
    "fmt"
)
// var file, _ = os.Open("input.txt")
// var outfile, _ = os.Create("output.txt")
// var in = bufio.NewScanner(file)
// var out = bufio.NewWriter(outfile)
var in = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriter(os.Stdout)

func next() string {
    if !in.Scan() {
        panic("Scan error")
    }
    return in.Text()
}

func nextInt() int {
    ret, _ := strconv.Atoi(next())
    return ret
}

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

func main() {
    defer out.Flush()
    in.Split(bufio.ScanWords)
    n := nextInt()
    if n % 2 == 1 {
        fmt.Fprintln(out, "black")
    } else {
        fmt.Fprintln(out, "white")
        fmt.Fprintln(out, "1 2")
    }
}


package main

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

// Input & Output
var (
	input  = bufio.NewScanner(os.Stdin)
	output = bufio.NewWriter(os.Stdout)
)

func main() {
	var n uint64
	input.Scan()
	n, _ = strconv.ParseUint(input.Text(), 10, 64)
	if n%2 == 1 {
		fmt.Fprintln(output, "black")
	} else {
		fmt.Fprintln(output, "white")
		fmt.Fprintln(output, 1, 2)
	}
	defer output.Flush()
}


package main
import "fmt"

func main() {
	var x int
	fmt.Scanf("%d", &x)
	if x % 2 == 0 {
		fmt.Println("white")
		fmt.Println(1, 2)
	} else {
		fmt.Println("black")
	}
}


package main

import "fmt"

func check(px, py, x, y, a, b, n, m int) int {
    var anw = 100000000
    var tx = px - x; if(tx < 0) { tx = -tx;}
    var ty = py - y; if(ty < 0) { ty = -ty;}
    if(tx == 0 && ty == 0) {
        return 0;
    }
    if(x+a > n && x-a < 1) {
        return anw;
    }
    if(y+b > m && y-b < 1) {
        return anw;
    }
    if(tx%a != 0 || ty%b != 0) {
        return anw;
    }
    if(tx/a%2 == ty/b%2) {
        //fmt.Println(px, py, x, y, a, b, tx/a, ty/b);
        if(tx/a < ty/b) {
            return ty/b;
        }
        return tx/a;
    } else {
        return anw;
    }
    return anw;
}

func main() {
    var n, m, x, y, a, b int
    fmt.Scanf("%d %d %d %d %d %d", &n, &m, &x, &y, &a, &b);
    var tmp int
    var anw = -1;
    tmp = check(n, 1, x, y, a, b, n, m);
    //fmt.Println(tmp);
    if anw == -1 || tmp < anw {
        anw = tmp;
    }
    tmp = check(1, m, x, y, a, b, n, m);
    //fmt.Println(tmp);
    if anw == -1 || tmp < anw {
        anw = tmp;
    }
    tmp = check(n, m, x, y, a, b, n, m);
    //fmt.Println(tmp);
    if anw == -1 || tmp < anw {
        anw = tmp;
    }
    tmp = check(1, 1, x, y, a, b, n, m);
    //fmt.Println(tmp);
    if anw == -1 || tmp < anw {
        anw = tmp;
    }
    if anw != -1 && anw != 100000000{
        fmt.Println(anw)
    } else {
        fmt.Println("Poor Inna and pony!")
    }
}


package main

import "fmt"

const mod = 1000000007
const maxn = 1000000 + 10

var rank [maxn]int64

func myinit() {
	rank[0] = 1
	var i int64
	for i = 1; i < maxn; i++ {
		rank[i] = rank[i-1] * i % mod
	}
}
func powmod(a, n int64) int64 {
	var ans int64
	ans = 1
	var i int64
	for i = 1; i <= n; i++ {
		ans = ans * a % mod
	}
	return ans
}
func main() {
	myinit()
	var n int64
	fmt.Scan(&n)
	var ans = (rank[n] - powmod(2, n-1) + mod) % mod
	fmt.Println(ans)
}


package main

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

var reader *bufio.Reader
var writer *bufio.Writer

const MOD = int64(1e9) + 7

func solve(n int64) int64 {
	var ans int64 = 1
	for i := int64(1); i <= n; i++ {
		ans *= i
		ans %= MOD
	}

	var tmp int64 = 1
	for i := int64(1); i <= n-1; i++ {
		tmp <<= 1
		tmp %= MOD
	}

	ans -= tmp
	for ans < 0 {
		ans += MOD
	}
	return ans
}

func main() {
	//ioutil.WriteFile("input.txt", []byte(generateInput()), os.ModeExclusive)

	debug := 1
	filename := "input.txt"
	if debug != 0 && len(os.Args) > 1 && os.Args[1] == "debug" {
		file, _ := os.Open(filename)
		reader = bufio.NewReaderSize(file, 1024*1024)
	} else {
		reader = bufio.NewReaderSize(os.Stdin, 1024*1024)
	}
	writer = bufio.NewWriterSize(os.Stdout, 1024*1024)

	n := readInt()
	ans := solve(n)
	fmt.Fprintln(writer, ans)

	writer.Flush()
}

func readInts() []int {
	line := readLine()
	fields := strings.Fields(line)
	res := make([]int, len(fields))
	for i := range fields {
		v, _ := strconv.ParseInt(fields[i], 10, 64)
		res[i] = int(v)
	}
	return res
}

func readInt() int64 {
	line := readLine()
	n, _ := strconv.ParseInt(line, 10, 32)
	return int64(n)
}

func readLine() string {
	str, _, err := reader.ReadLine()
	if err == io.EOF {
		return ""
	}

	return strings.TrimRight(string(str), "\r\n")
}


package main

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

type contest struct {
	in  io.Reader
	out io.Writer
}

func (con *contest) Scan(a ...interface{}) (int, error) {
	return fmt.Fscan(con.in, a...)
}
func (con *contest) Scanln(a ...interface{}) (int, error) {
	return fmt.Fscanln(con.in, a...)
}
func (con *contest) Scanf(f string, a ...interface{}) (int, error) {
	return fmt.Fscanf(con.in, f, a...)
}
func (con *contest) Print(a ...interface{}) (int, error) {
	return fmt.Fprint(con.out, a...)
}
func (con *contest) Println(a ...interface{}) (int, error) {
	return fmt.Fprintln(con.out, a...)
}
func (con *contest) Printf(f string, a ...interface{}) (int, error) {
	return fmt.Fprintf(con.out, f, a...)
}
func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	con := &contest{in: in, out: out}
	con.main()
}

const m = 1e9 + 7

func (con *contest) main() error {
	var n int64
	con.Scan(&n)
	var x int64 = 1
	for i := int64(1); i <= n; i++ {
		x *= i
		x %= m
	}
	var y int64 = 1
	for i := int64(1); i <= n-1; i++ {
		y *= 2
		y %= m
	}
	x -= y
	if x < 0 {
		x += m
	}
	con.Println(x)
	return nil
}


package main

import (
    "fmt"
    "strconv"
)

type pos struct{
    x int
    y int
}

var whites = [9][9]int{}

func mark_rock(board *[9][9]int, pos_r pos){
    for i:=pos_r.x+1; i<=8; i++{
        board[i][pos_r.y] += 1
        if whites[i][pos_r.y] != 0{
            break
        }
    }
    for i:=pos_r.x-1; i>=1; i--{
        board[i][pos_r.y] += 1
        if whites[i][pos_r.y] != 0{
            break
        }
    }
    for j:=pos_r.y+1; j<=8; j++{
        board[pos_r.x][j] += 1
        if whites[pos_r.x][j] != 0{
            break
        }
    }
    for j:=pos_r.y-1; j>=1; j--{
        board[pos_r.x][j] += 1
        if whites[pos_r.x][j] != 0{
            break
        }
    }
}

func is_valid(x int, y int) bool{
    if x>=1 && x<=8{
        return y>=1 && y<=8
    }
    return false
}

var move_x = [3]int{-1, 0, 1}
var move_y  = [3]int{-1, 0, 1}

func mark_king(board *[9][9]int, pos_k pos){
    for i:=0; i<3; i++{
        for j:=0; j<3; j++{
            x:= pos_k.x+move_x[i]
            y:= pos_k.y+move_y[j]
            if !is_valid(x,y){
                continue
            }
            board[x][y] += 1
        }
    }
}

func Result(wr1 pos, wr2 pos, bk pos, board [9][9]int) string{
    for i:= 0; i<3; i++{
        for j:=0; j<3; j++{
            x:= bk.x + move_x[i]
            y:= bk.y + move_y[j]
            if x==0 && y==0{
                continue
            }
            if !is_valid(x,y){
                continue
            }
            if board[x][y] == 0{
                return "OTHER"
            }
            if board[x][y] == 1 && whites[x][y] == 1{
                return "OTHER"
            }
        }
    }
    return "CHECKMATE"
}

func main(){
    chess := map[string]pos{}
    toi := [8]byte{'a','b', 'c', 'd', 'e', 'f', 'g', 'h'}
    for k, letter := range toi{
        for j:=1; j<=8; j++{
            chess[string(letter) + strconv.Itoa(j)] = pos{k+1, j}
            whites[k+1][j] = 0
        }
    }
    board := [9][9]int{}
    var wr, wr2, wk, bk string
    fmt.Scanf("%s %s %s %s", &wr, &wr2, &wk, &bk)
    pos_wr, _ := chess[wr]
    board[pos_wr.x][pos_wr.y] = 1 //rock
    whites[pos_wr.x][pos_wr.y] = 1 //rock
    pos_wr2, _ := chess[wr2]
    board[pos_wr2.x][pos_wr2.y] = 1 //rock
    whites[pos_wr2.x][pos_wr2.y] = 1 //rock
    pos_wking, _ := chess[wk]
    board[pos_wking.x][pos_wking.y] = 1 //white king
    whites[pos_wking.x][pos_wking.y] = 2  //white king
    pos_bking, _ := chess[bk]

    mark_rock(&board, pos_wr)
    mark_rock(&board, pos_wr2)
    mark_king(&board, pos_wking)
    //show(board)
    fmt.Println(Result(pos_wr, pos_wr2, pos_bking, board))
}

func show(board [9][9]int){
    for i:=1; i<=8; i++{
        for j:=1; j<=8; j++{
            fmt.Printf("%d,%d:%v ", i, j, board[i][j])
        }
        fmt.Printf("\n")
    }
    fmt.Println("---------------")
}


package main

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

func main() {
	r := bufio.NewReaderSize(os.Stdin, 1<<16)
	s, _, _ := r.ReadLine()
	lc := byte('a') - 1
	var ok = true
	for i := 0; i < len(s); i++ {
		c := s[i]
		if c > lc {
			if c == lc + 1 {
				lc = c
			} else {
				ok = false
			}
		}
	}
	if ok {
		fmt.Print("YES\n")
	} else {
		fmt.Print("NO\n")
	}
}


package main

import "fmt"

func main() {
	var n, m, x, y int
	fmt.Scan(&n, &m)
	if n > m {
		x = n
	}else{
		x = m
	}

	if n < m {
		y = n
	}else{
		y = m
	}

	fmt.Print( x-1, y)
}


//257B
package main
import "fmt"

func main() {
	var nn, mm int
	fmt.Scan(&nn, &mm)
	if nn>=mm {
		fmt.Println(nn-1, mm)
	} else {
		fmt.Println(mm-1, nn)
	}
}


package main

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

func Init() {
}

func Solve(io *FastIO) {
	io.NextInt()
	S := io.NextLine() + " "

	maxCaps := 0
	curCaps := 0
	for _, c := range S {
		if c == ' ' {
			maxCaps = Max(maxCaps, curCaps)
			curCaps = 0
		} else if c >= 'A' && c <= 'Z' {
			curCaps++
		}
	}
	io.Println(maxCaps)
}

func Max(args ...int) int {
	max := args[0]
	for i := 1; i < len(args); i++ {
		if args[i] > max {
			max = args[i]
		}
	}
	return max
}

type FastIO struct {
	reader *bufio.Reader
	writer *bufio.Writer
}

func (io *FastIO) NextChar() byte {
	c, _ := io.reader.ReadByte()
	return c
}

func (io *FastIO) NextInt() int {
	c := io.NextChar()
	for IsSpaceChar(c) {
		c = io.NextChar()
	}
	sgn := 1
	if c == '-' {
		sgn = -1
		c = io.NextChar()
	}
	res := 0
	for !IsSpaceChar(c) {
		res = (res * 10) + int(c - '0')
		c = io.NextChar()
	}
	return sgn * res
}

func (io *FastIO) NextLong() int64 {
	c := io.NextChar()
	for IsSpaceChar(c) {
		c = io.NextChar()
	}
	sgn := int64(1)
	if c == '-' {
		sgn = -1
		c = io.NextChar()
	}
	res := int64(0)
	for !IsSpaceChar(c) {
		res = (res * 10) + int64(c - '0')
		c = io.NextChar()
	}
	return sgn * res
}

func (io *FastIO) NextIntArray(size int) []int {
	return io.NextIntArrayOffset(size, 0)
}

func (io *FastIO) NextIntArrayOffset(size, offset int) []int {
	arr := make([]int, size + offset)
	for i := 0; i < size; i++ {
		arr[i + offset] = io.NextInt()
	}
	return arr
}

func (io *FastIO) NextLongArray(size int) []int64 {
	return io.NextLongArrayOffset(size, 0)
}

func (io *FastIO) NextLongArrayOffset(size, offset int) []int64 {
	arr := make([]int64, size + offset)
	for i := 0; i < size; i++ {
		arr[i + offset] = io.NextLong()
	}
	return arr
}

func (io *FastIO) NextString() string {
	c := io.NextChar()
	for (IsSpaceChar(c)) {
		c = io.NextChar()
	}
	var sb bytes.Buffer
	for !IsSpaceChar(c) {
		sb.WriteByte(c)
		c = io.NextChar()
	}
	return sb.String()
}

func (io *FastIO) NextLine() string {
	c := io.NextChar()
	for (IsSpaceChar(c)) {
		c = io.NextChar()
	}
	var sb bytes.Buffer
	for !IsLineBreakChar(c) {
		sb.WriteByte(c)
		c = io.NextChar()
	}
	return sb.String()
}

func (io *FastIO) Println(args ...interface{}) {
	io.writer.WriteString(fmt.Sprintln(args...))
}

func (io *FastIO) Printf(format string, args ...interface{}) {
	io.writer.WriteString(fmt.Sprintf(format, args...))
}

func (io *FastIO) FlushOutput() {
	io.writer.Flush()
}

func IsSpaceChar(c byte) bool {
	switch c {
	case 0, '\t', '\n', '\r', ' ':
		return true
	default:
		return false
	}
}

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

func main() {
	io := FastIO{reader: bufio.NewReader(os.Stdin), writer: bufio.NewWriter(os.Stdout)}
	Init()
	Solve(&io)
	io.FlushOutput()
}


package main

import (
	"fmt"
	"math"
)

func gcd(a, b int64) int64 {
	switch {
	case a == 0 && b > 0:
		return b
	case a > 0 && b == 0:
		return a
	case a == b:
		return a
	case a == 1 && b > 0:
		return 1
	case a > 0 && b == 1:
		return 1
	case a%2 == 0 && b%2 == 0:
		return 2 * gcd(a/2, b/2)
	case a%2 == 0 && b%2 == 1:
		return gcd(a/2, b)
	case a%2 == 1 && b%2 == 0:
		return gcd(a, b/2)
	case b > a:
		return gcd((b-a)/2, a)
	case b < a:
		return gcd((a-b)/2, b)
	default:
		panic("not reachable")
	}
}

func main() {
	var n, k int64
	fmt.Scanf("%d %d", &n, &k)
	k = int64(math.Pow10(int(k)))
	fmt.Println(n * k / gcd(n, k))
}


package main

import (
        "fmt"
)

var n int64
var k int

func main() {
        fmt.Scanf("%d %d", &n, &k)
        cnt2 := 0
        cnt5 := 0
        res := n
        for {
                if cnt5 >= k || res%5 != int64(0) {
                        break
                }
                res = res / 5
                cnt5++
        }
        for {
                if cnt2 >= k || res%2 != int64(0) {
                        break
                }
                res = res / 2
                cnt2++
        }
        for i := 0; i < k; i++ {
                res = res * 10
        }
        fmt.Println(res)
}