jiahuimbzuai/CoQuIR huggingface dataset:
//  [ruby]
class PriorityQueue
    def initialize(arr)
        @size = arr.size
        @array = arr
        @array.unshift(nil)
        h = (@size / 2) | 0
        h.downto(1) do |i|
            maxHeapify(i)
        end
    end
    def getArray
        return @array[1..@size]
    end
    def maxHeapify(i)
        left = 2 * i
        right = 2 * i + 1
        largest = 0
        if left <= @size && @array[left] > @array[i]
            largest = left
        else
            largest = i
        end
        if right <= @size && @array[right] > @array[largest]
            largest = right
        end
        if largest != i
            @array[i], @array[largest] = @array[largest], @array[i]
            maxHeapify(largest)
        end
    end
    def pop
        return -(1<<29) if @size < 1
        maxv = @array[1]
        @array[1] = @array[@size]
        @size -= 1
        maxHeapify(1)
        maxv
    end
    def push(e)
        @size += 1
        i = @size
        @array[i] = -(1<<29)
        return if e < @array[i]
        @array[i] = e
        while i > 1 && @array[i/2] < @array[i]
            @array[i], @array[i/2] = @array[i/2], @array[i]
            i = i / 2
        end
    end
end

n, k = gets.chomp.split(" ").map(&:to_i)
h = gets.chomp.split(" ").map(&:to_i)

if n > k
    pq = PriorityQueue.new(h)
    k.times do |i|
        pq.pop
    end
    puts pq.getArray.inject(:+)
else
    puts 0
end
//  [ruby]
n,k = gets.split(" ").map(&:to_i)
hn = gets.split(" ").map(&:to_i)
if n <= k
  p 0
elsif k.zero?
  p hn.inject(&:+)
elsif hn.length == n
  hns = hn.sort{|a, b| b.to_i <=> a.to_i }
  hns.slice!(0..k-1)

  p hns.inject(&:+)
end
//  [rust]
use text_io::*;
use std::collections::*;
use std::process::exit;

fn main() {
    let mut n:usize = read!();
    let mut k:usize = read!();
    let mut v:Vec<usize> = Vec::new();
    for i in 0..n {
        let a:usize = read!();
        v.push(a);
    }
    v.sort();
    // v.reverse();
    let mut g:usize = 0;
    if n<=k {
        println!("0");
        exit(0);
    }
    for i in 0..n-k {
        g += v[i];
    }
    println!("{}",g);
}
//  [rust]
use std::io::*;
use std::str::FromStr;

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

pub fn read_n<T: FromStr>(n: usize) -> Vec<T> {
    read_n_logic::<T>(n, vec![])
}

pub fn read_n_logic<T: FromStr>(n: usize, mut a: Vec<T>) -> Vec<T> {
    match n {
        0 => a,
        _ => {
            a.push(read::<T>());
            read_n_logic(n - 1, a)
        }
    }
}
use std::cmp::{max, min};

fn main() {
    let n: usize = read();
    let k: usize = read();
    let mut a: Vec<i64> = read_n(n);
    a.sort();

    if k >= n {
        println!("{}", 0);
        return;
    }

    a.split_off(max(n - k, 0));
    println!("{}", a.iter().sum::<i64>());
}
//  [typescript]
function Main(input) {
    const lines = input.split("\n");
    const [N, K] = lines[0].split(' ');
    const descHs = lines[1].split(' ').map(v => +v).sort((a, b) => b - a);
    
    console.log(descHs.slice(K).reduce((acc, val) => acc + val, 0));
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [typescript]
const main = (input) => {
  const lines = input.trim().split("\n")
  const [N, K] = lines[0].split(" ").map(str => parseInt(str))
  let H = lines[1].split(" ").map(str => parseInt(str))
  H.sort((a, b) => a - b).reverse()
  H = H.slice(K)
  const sum = (arr) => arr.reduce((a , b) => a + b, 0)
  console.log(sum(H))
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [typescript]
const main = (input: string) => {
  const lines = input.trim().split("\n")
  const [N, K] = lines[0].split(" ").map(str => parseInt(str))
  let H = lines[1].split(" ").map(str => parseInt(str))
  H.sort((a, b) => a - b)

  if(K > 0) { H.splice(-K) }

  const sum = (arr: number[]) => {
    if(arr.length !== 0) {
      return arr.reduce((a:number , b: number) => a + b)
    }
    return 0
  }

  console.log(sum(H))
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [python]
x, y, z = map(int, input().split())
m = x - z
print(m // (y + z))
//  [python]
a = input().split()
b = int(a[0])
c = int(a[1])
d = int(a[2])
b = b-d
F = int(b/(c+d))
print(F)
//  [python]
x, y, z = map(int, input().split())

a = (x - z) // (y + z)
print(a)
//  [python]
import numpy as np


def getInput():
    """

    :return: list of list of str. 1st dim: row, 2nd dim: column.
    """
    separator = ' '
    ret_array = []
    while True:
        try:
            row = input().split(sep=separator)
            ret_array.append(row)
        except EOFError:
            break
    return ret_array


g = getInput()

# number
xyz = np.array(list(map(int, g[0])), dtype=np.int32)
print(np.int32(np.floor((xyz[0] - xyz[2]) / (xyz[1] + xyz[2]))))
//  [python]
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
inf = float('inf')
ninf = -float('inf')
 
#整数input
def ii(): return int(sys.stdin.readline().rstrip()) #int(input())
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) #list(map(int,input().split()))
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]
#文字列input
def ss(): return sys.stdin.readline().rstrip() #input()
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) #list(input().split())
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]

#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？

x,y,z=mii()

a=x-z
b=a//(y+z)
print(b)
//  [python]
# -*- coding: utf-8 -*-

from queue import Queue
import sys
import subprocess
import json
import time
import math
import re
#import sqlite3
import random
import numpy as np
#from sklearn.datasets import fetch_mldata
from statistics import mean, median, variance, stdev
#from chainer import cuda, Variable, FunctionSet, optimizers
#import chainer.functions  as F

def ans():
    remain = X - Y - 2 * Z
    if (remain < 0): return 0
    return 1 + remain // (Y + Z)
    

X, Y, Z = map(int, input().split())
print(ans())
//  [java]
import java.util.*;
import java.io.*;

public class Main {
    private static IO io = new IO();
    public static void main(String[] args) {
        
        int x = io.nextInt();
        int y = io.nextInt();
        int z = io.nextInt();
        int ans = x/(y+z);
        if (x%(y+z)<z) ans--;
        System.out.println(ans);
        
    }

    static class IO extends PrintWriter {
        private final InputStream in;
        private final byte[] buffer = new byte[1024];
        private int ptr = 0;
        private int buflen = 0;

        IO() {
            this(System.in);
        }

        IO(InputStream source) {
            super(System.out);
            this.in = source;
        }

        boolean hasNextByte() {
            if (ptr < buflen) return true;
            else {
                ptr = 0;
                try {
                    buflen = in.read(buffer);
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (buflen <= 0) return false;
            }
            return true;
        }
        int readByte() {
            if (hasNextByte()) return buffer[ptr++];
            else return -1;
        }
        boolean isPrintableChar(int c) {return 33<=c &&c <=126;}
        void skipUnprintable() {while(hasNextByte() && !isPrintableChar(buffer[ptr]))ptr++;}
        boolean hasNext() {
            skipUnprintable();
            return hasNextByte();
        }

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

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

        public void close() {
            super.close();
            try {
                in.close();
            } catch (IOException ignored) {
            }
        }
    }
}
//  [java]
import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.List;
import java.util.StringJoiner;
import java.util.stream.Collectors;

@SuppressWarnings("ALL")
public class Main {

    public static void main(String[] args) {
        List<Integer> values = IO.readLineAsIntList();
        int x = values.get(0);
        int y = values.get(1);
        int z = values.get(2);

        int n = x / y;
        for (; n >=0; n--) {
            if( n * y + (n + 1) * z <= x ) {
                break;
            }
        }
        IO.writeLine("" + n);
    }

    public static class IO {

        private static BufferedReader br;

        private static BufferedReader br() {
            if( br == null ) {
                br = new BufferedReader( new InputStreamReader(new BufferedInputStream(System.in), StandardCharsets.UTF_8) );
            }
            return br;
        }

        public static String readLine() {
            try {
                return br().readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }

        public static int readLineAsInt() {
            return Integer.parseInt(readLine());
        }

        public static List<String> readLineAsList() {
            return Arrays.asList( readLine().split(" "));
        }

        public static List<Integer> readLineAsIntList() {
            return readLineAsList().stream()
                    .map( Integer::parseInt )
                    .collect(Collectors.toList());
        }

        public static void writeLine(String line) {
            System.out.println( line );
        }

        public static void writeLine(List<Integer> values) {
            StringJoiner j = new StringJoiner(" ");
            values.forEach(i -> j.add(String.valueOf(i)) );
            writeLine(j.toString());
        }

        public static void writeLines(List<String> lines) {
            lines.forEach(System.out::println);
        }
    }
}
//  [java]
import java.util.Scanner;
import java.util.stream.IntStream;
class Main{
	static Scanner s=new Scanner(System.in);
	static int gInt(){return Integer.parseInt(s.next());}
	public static void main(String[]$){
		long x=gInt(),y=gInt(),z=gInt();
		System.out.println(
				IntStream.range(0,114514)
				.filter(i->x>=y*i+z*i+z)
				.max().getAsInt()
				);
	}
}
//  [cpp]
#include <cstdio>
#include <cmath>
#include <numeric>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <utility>
#include <string>

using namespace std;

typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ul;

const int iinf = 1 << 29;
const long long linf = 1l << 61;

int main(int argc, char* argv[])
{
	int X, Y, Z;
	scanf("%d %d %d", &X, &Y, &Z);
	printf("%d", (X - Z) / (Y + Z));

	return 0;
}
//  [cpp]
#include<stdio.h>
int main()
{
	int x,y,z,sum;
	while(scanf("%d%d%d",&x,&y,&z)!=EOF)
	{
		sum=(x-(y+2*z))/(y+z)+1;
		printf("%d\n",sum);
	}
}
//  [cpp]
#include <algorithm>
#include <queue>
#include <cstdio>
typedef long long LL ;
using namespace std ;
int main()
{
    int X,Y,Z;
    while(scanf("%d %d %d",&X,&Y,&Z)!=EOF)
    {
        int sum;
        sum=X-Z;
        printf("%d\n",sum/(Y+Z));
    }
    return 0;
}
//  [cpp]
#include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
using namespace std;
int main(){
	int a,b,c;
	cin>>a>>b>>c;
	cout<<(a-c)/(b+c)<<endl;
	return 0;
}
//  [cpp]
#include<iostream>
#include<iomanip>
#include<math.h>
#include<cstdlib>
#include<algorithm>
#include<string>
#include<set>
#include<vector>
using namespace std;

#define INF 1<<21
#define MOD 1000000007

int main(){
    int x,y,z;
    int ans=0;
    cin>>x>>y>>z;
    x-=2*z+y;
    ans=x/(y+z);
    cout<<ans+1<<endl;
    return 0;
}
//  [cpp]
#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <iomanip>
#include <set>
#include <cmath>
#include <math.h>

using namespace std;
        
int main(){
    int x,y,z;
    cin>>x>>y>>z;
    int len=x,ans=0;
    while(1){
            len-=z;
            len-=y;
            if(len>=z){
                ans++;
            }else{
                cout<<ans<<endl;
                break;
            }
    }
    return 0;
}
//  [c]
#include <stdio.h>
int main(void)
{
    int x,y,z;
    scanf("%d %d %d",&x,&y,&z);
    int c=y+z;
    int ans=(x-z)/c;
    printf("%d",ans);
}
//  [c]
#include<stdio.h>
#include <stdlib.h>
#include <string.h>

int main()
{

    int  X, Y ,Z;
 // 整数の入力
    scanf("%d %d %d", &X, &Y, &Z);
    
   printf("%d", (X -Z) / (Y + Z )  );

    return 0;
}
//  [c]
#include <stdio.h>

int main(void){
	int a,x,y,z;
	scanf("%d %d %d",&x,&y,&z);
	a=(x-z)/(y+z);
	printf("%d\n",a);
	return 0;
}
//  [c]
#include <stdio.h>
int main(void){
    int x, y, z, ans = 0;
    
    scanf("%d %d %d", &x, &y, &z);
    
    ans = (x - z) / (y + z);
    printf("%d\n", ans);
}
//  [c]
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include <limits.h>
#include <stdbool.h>

#define rep(i, n) for(int i=0; i<(n); ++i)
#define max  200001

//qsort(str, n, sizeof(int), up_comp);
int up_comp(const void *a, const void *b){return *(int*)a - *(int*)b;}
int down_comp(const void *a, const void *b){return *(int*)b - *(int*)a;}
int int_sort( const void * a , const void * b ) {return strcmp(( char * )a , ( char * )b );}
int count_digit(int a){int i=0;while(a!=0){a=a/10;i++;}return i;}
int euclid( int a, int b ){int temp;if(a<b){temp=a;a=b;b=temp;}if(b<1)return -1;if(a%b==0) return b;return euclid(b,a%b);}

int main(void){
    
    int x, y, z;
    int ans;
    
    scanf("%d%d%d", &x, &y, &z);
    
    ans=(x-z)/(y+z);
    
    printf("%d", ans);

    return 0;
}
//  [c]
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>



void swap (int *x, int *y) {
  int temp;

  temp = *x;
  *x = *y;
  *y = temp;

  return;
}


int gcd(int a, int b){
  int c;

  while (b > 0){
    c = a % b;
    a = b;
    b = c;
  }

  return a;
}

long int modpow(long int a,long int n,long int mod){
  long int ans=1;
  while(n>0){
    if(n & 1){
      ans=ans*a%mod;
    }
    a=a*a%mod;
    n/=2;
  }
  return ans;
}

long int modinv(long int a,long int mod){
  return modpow(a,mod-2,mod);
}

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

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

void chmax(int *a,int b){
  if(*a < b){
    *a = b;
  }

  return;
}

void chmin(int *a,int b){
  if(*a > b){
    *a =b;
  }

  return;
}

int main(void){
  int x,y,z;
  scanf("%d%d%d",&x,&y,&z);
  int ans=0;
  for(int i=0;i<x;i++){
    if((y+2*z+i*(y+z))<=x){
      ans++;
    }else{
      break;
    }
  }
  printf("%d\n",ans);
  return 0;
}
//  [javascript]
"use strict"

function main(input) {
  input = input.split(" ").map(v => ~~v)
  const Y = input[1] // human width
  const Z = input[2] // margin
  const YZ = Y + Z
  const X = input[0] - Z // chair width

  const ans = Math.floor(X / YZ)
  console.log(ans)
}
main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main(input) {
	var lines = input.split("\n");
    var x,y,z;
	var parsed = lines[0].split(" ").map(function(v,i,a){return parseInt(v);});
    x = parsed[0]; y = parsed[1]; z = parsed[2];
	console.log(Math.floor((x-z)/(y+z)));
}


//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main(input) {
  input = input.split("\n");
  var x = parseInt(input[0].split(" ")[0]);
  var y = parseInt(input[0].split(" ")[1]);
  var z = parseInt(input[0].split(" ")[2]);
  var ans=0;
  ans=Math.floor((x-z)/(z+y));
  console.log('%s', ans);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
(function() {
    'use strict';

    var lines = [];
    require('readline').createInterface({
      input: process.stdin,
      output: process.stdout
    }).on('line', function(line) {
      lines.push(line);
    });
    process.stdin.on('end', function() {
      //lines.forEach(function(line) {
        //var tokens = line.split(' ').map(Number);
        //    console.log(tokens[0] + ' ' + tokens[1]);
      //}
      //)
      ;

    // ToDo start
      var inLines = lines[0].split(" ")
      var X = parseInt(inLines[0]);
      var Y = parseInt(inLines[1]);
      var Z = parseInt(inLines[2]);

      console.log(Math.floor( (X - Z ) / (Y + Z ) ) )
      
//      console.log( Math.pow(parseInt(lines[0]),2) - parseInt(lines[1])  )
    // ToDo end

    });


})();
//  [javascript]
process.stdin.resume();
process.stdin.setEncoding('utf8');

var g_input = '';
process.stdin.on('data', function(chunk) {
    g_input += chunk;
});

process.stdin.on('end', function() {
    Main(g_input.split(/\r?\n/));
});

function Main(input) {

    var values = input[0].split(' ');
    var x = parseInt(values[0], 10);
    var y = parseInt(values[1], 10);
    var z = parseInt(values[2], 10);

    var ans = Math.floor((x - z) / (y + z));
    console.log(ans);

    return 0;
}
//  [javascript]
'use strict'

const main = (input) => {
    input = input.split(' ').map(v => parseInt(v))
    const X = input[0]
    const Y = input[1]
    const Z = input[2]
    const n = Y + Z
    const w = X - Z
    console.log(Math.floor(w / n))
}

main(require('fs').readFileSync('/dev/stdin', 'utf-8'))
//  [go]
package main

import (
	"fmt"
)

func main() {
	var x, y, z int
	fmt.Scan(&x, &y, &z)

	fmt.Println((x-z)/(y+z))
}
//  [go]
package main

import (
  "fmt"
)

func main() {
  var x, y, z int 
  fmt.Scan(&x, &y, &z)
  fmt.Println((x - z) / (y + z))
}
//  [go]
package main

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

var sc = bufio.NewScanner(os.Stdin)

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

func iScan() int {
	n, _ := strconv.Atoi(Scan())
	return n
}

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

var mod int = 1000000007

func main() {
	buf := make([]byte, 0)
	sc.Buffer(buf, mod)
	sc.Split(bufio.ScanWords)
	x, y, z := iScan(), iScan(), iScan()
	fmt.Println((x - z) / (y + z))
}
//  [go]
package main

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

func main() {
	scanInit()

	x := nextInt()
	y := nextInt()
	z := nextInt()

	x -= z

	fmt.Println(x / (y + z))

}

// ---- readfunc
var sc = bufio.NewScanner(os.Stdin)

func scanInit() {
	const cap = 200 * 1024 // default=64*1024
	var buf = make([]byte, cap)
	sc.Buffer(buf, cap)
	sc.Split(bufio.ScanWords)
	return
}
func nextInt() int {
	sc.Scan()
	i, _ := strconv.Atoi(sc.Text())
	return i
}
func nextStr() string {
	sc.Scan()
	return sc.Text()
}
//  [ruby]
x, y, z = gets.strip.split.map(&:to_i)

puts (x - z) / (y + z)
//  [ruby]
x, y, z = gets.chomp.split(" ").map(&:to_i)
puts (x-z) / (y+z)
//  [ruby]
x, y, z = gets.strip.split.map(&:to_i)
sum = y+2*z
if x == sum
  puts 1
elsif x < sum
  puts 0
else
  puts (x-sum)/(y+z)+1
end
//  [ruby]
x,y,z = gets.split.map(&:to_i)
x -= z
puts x / (y+z)
//  [ruby]
x,y,z = gets.strip.split.map(&:to_i)
puts (x-z)/(y+z)
//  [ruby]
x,y,z = gets.chomp.split(' ').map(&:to_i)
ans = 0
while true
  if (y * ans + z * (ans + 1)) > x
    break
  end
  ans += 1
end
puts ans - 1
//  [rust]
#![allow(unused_imports)]

macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String {
            bytes
                .by_ref()
                .map(|r| r.unwrap() as char)
                .skip_while(|c| c.is_whitespace())
                .take_while(|c| !c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

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

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

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

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

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

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

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

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

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

use std::cmp::{min, max};
use std::collections::{HashMap, HashSet, VecDeque, BinaryHeap};

fn main() {
    input!{
        x: usize,
        y: usize,
        z: usize
    }
    println!("{}", (x - z) / (y + z));
}
//  [rust]
use std::io::*;
use std::str::FromStr;

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

fn main() {
    let x: i64 = read();
    let y: i64 = read();
    let z: i64 = read();

    if x <= z {
        println!("0");
        return;
    };

    println!("{}", (x - z) / (y + z));
}
//  [rust]
use std::io;

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

fn main() {
	let v:Vec<i32> = procon_read();
	let x = v[0];
	let y = v[1];
	let z = v[2];
	if x%(y+z) >= z {
		println!("{}", x/(y+z));
	}else{
		println!("{}", x/(y+z) - 1);
	}
}
//  [rust]
#![allow(unused_imports)]
// use itertools::Itertools;
use proconio::{input, marker::*};

fn main() {
    input! {
        x: usize,
        y: usize,
        z: usize
    };
    println!("{}", (x - z) / (y + z));
}
//  [rust]
use std::io::Read;

fn main() {
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();

    let answer = solve(&buf);

    println!("{}", answer);
}

fn solve(input: &str) -> String {
    let mut iterator = input.split_whitespace();

    let x: usize = iterator.next().unwrap().parse().unwrap();
    let y: usize = iterator.next().unwrap().parse().unwrap();
    let z: usize = iterator.next().unwrap().parse().unwrap();

    let mut ans = 0;
    for i in 0.. {
        if y * i + z * (i + 1) <= x {
            ans = i;
        } else {
            break;
        }
    }
    ans.to_string()
}
//  [rust]
fn main() {
    proconio::input! {
    a:usize,
    b:usize,
    c:usize,
    }
    let mut d=0;
    let mut e=0;
    d+=c;
    while d+b+c<=a {
        d+=b+c;
        e+=1
    }
    println!("{}",e)
}
//  [swift]
//
//  main.swift
//  AtCoderSwift
//
//  Created by burita083 on 2020/08/25.
//  Copyright © 2020 burita083. All rights reserved.
//

import Foundation
func readInt() -> Int {
    return Int(readLine()!)!
}
 
func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}
 
func readTwoInts() -> (a: Int, b: Int) {
    let ints = readLine()!.split(separator: " ").map { Int($0)! }
    return (a: ints[0], b: ints[1])
}

func abc080_b() {
    let N = readLine()!
    let sum = N.map { Int(String($0))! }.reduce(0, +)
    print(Int(N)! % sum == 0 ? "Yes" : "No")
}

//abc080_b()

func abc078_b() {
    let input = readInts()
    var X = input[0]
    let Y = input[1]
    let Z = input[2]
    var ans = 0
    X -= Y+Z*2
    ans += 1
    ans += X/(Y+Z)
    
    print(ans)
}

abc078_b()
//  [swift]
import Foundation
func toTuple<T>(_ args: [T]) -> (T, T, T) { (args[0], args[1], args[2]) }
func readInts() -> [Int] { readLine()!.split(separator: " ").map { Int($0)! } }

let (x, y, z) = toTuple(readInts())
print((x - z) / (y + z))
//  [swift]
import Foundation

#if swift(>=4.0)
extension String {
    func split(by separator: String) -> [String] {
        return self.components(separatedBy: separator)
    }
    func toArray() -> [String] {
        return self.map{String($0)}
    }
}
func exponentiate(_ lhs: Int, _ rhs: Int) -> Int {
    return (0..<rhs).reduce(1){i,_ in i*lhs}
}
#else
extension String {
    func split(by separator: String) -> [String] {
        return self.componentsSeparatedByString(separator)
    }
    var count: Int {
        return self.characters.count
    }
    func toArray() -> [String] {
        return self.characters.map{String($0)}
    }
    func uppercased() -> String {
        return self.uppercaseString
    }
    func lowercased() -> String {
        return self.lowercaseString
    }
}
//extension Array where Element == String {
//    func joined(separator separator: String) -> String {
//        return self.joinWithSeparator(separator)
//    }
//}
extension Array where Element: Comparable {
    func max() -> Element {
        return self.maxElement()!
    }
    func min() -> Element {
        return self.minElement()!
    }
    func sorted() -> Array {
        return self.sort()
    }
    func reversed() -> Array {
        return self.reverse()
    }
    mutating func sort() {
        self.sortInPlace()
    }
}
extension Array {
    init(repeating: Element, count: Int) {
        self.init(count: count, repeatedValue: repeating)
    }
}
func stride<T: Strideable>(from start: T, to end: T, by stride: T.Stride) -> StrideTo<T> {
    return start.stride(to: end, by: stride)
}
func exponentiate(lhs: Int, _ rhs: Int) -> Int {
    return (0..<rhs).reduce(1){i,_ in i*lhs}
}
#endif
func readInt() -> Int? {
    return Int(readLine()!)
}
func readStringSplit(by separator: String) -> [String] {
    return readLine()!.split(by: separator)
}
func readIntSplit(by separator: String) -> [Int] {
    return readLine()!.split(by: separator).map{Int($0)!}
}

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

//var min, min2, count: Int!
//for i in 1...10 {
//    let x = Int(readLine()!)!
//    if i == 1 {
//        min = x
//        count = 1
//    } else if x < min {
//        min2 = min
//        min = x
//        count = 1
//    } else if x == min && count == 1 {
//        min2 = x
//        count = 2
//    }
//}
//print(min2)

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

let input = readIntSplit(by: " ")
let (X, Y, Z) = (input[0], input[1], input[2])
print((X-Z)/(Y+Z))
//  [typescript]
"use strict";
const Main = (input) =>{
   let xs = input.trim().split(' ').map(v=>parseInt(v,10));
　 let X = xs[0];
   let Y = xs[1];
   let Z = xs[2];
   let i = 0;   
   let ans = 0;
   while(true){
     ans=Y*i+Z*(i+1);
     //console.log(ans);
     if(ans<=X){
       i++;
     }else{
       console.log(i-1);
       break;
     }
   }
}
Main(require('fs').readFileSync('/dev/stdin','utf8'));
//  [typescript]
const input=require('fs').readFileSync('/dev/stdin','utf8').split(/[\s]/);const tn=():number=>{const a=input[0];input.shift();return Number(a)};const tnn=(n:number):number[]=>{const a=[];for(let i=0;i<n;i++){a.push(tn())}return a};const ts=():string=>{const a=input[0];input.shift();return String(a)};const tss=(n:number):string[]=>{const a=[];for(let i=0;i<n;i++){a.push(ts())}return a};const tc=():string=>{let a=input[0].split('');const b=a[0];a.shift();if(a.length>0){input[0]=a.join('')}else{input.shift()}return String(b)};const tcc=(n:number):string[]=>{const a=[];for(let i=0;i<n;i++){a.push(tc())}return a};const to=(...arg)=>{console.log(...arg)};const abs=(a)=>{return Math.abs(a)};const min=(...a)=>{return Math.min(...a)};const max=(...a)=>{return Math.max(...a)};const floor=(a)=>{return Math.floor(a)};const asc=(ar:number[])=>{return ar.sort((a,b)=>{return a-b})};const desc=(ar:number[])=>{return ar.sort((a,b)=>{return b-a})};const sw=(a,arr:any[],op:'=='|'>='|'>'|'<='|'<'='==')=>{for(let i=0;i<arr.length;i+=2){if(eval(a+op+arr[i]))return arr[i+1];}return arr[arr.length-1]};const near=(n:number,arr:number[]):number=>{let ne=arr[0],ni=0;for(let i=1;i<arr.length;i++){if(Math.abs(n-ne)>Math.abs(n-arr[i])){ne=arr[i];ni=i}}return ni};const gojo=(a:number,b:number):number=>{if(a%b===0)return b;return gojo(b,a%b)};
const main=()=>{
  let [a,b,c]=tnn(3)
  to(floor((a-c)/(b+c)))
}
main()
//  [typescript]
"use strict";

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

function main(input) {
  const [x, y, z] = input.trim().split(" ").map(Number);

  const ans = Math.floor((x - z) / (y + z));
  console.log(ans);
}
//  [typescript]
import { readFileSync } from "fs";

const read = () =>
  readFileSync(0, "utf8")
    .split("\n")
    .map((line) => line.split(" "));

const main = (input: string[][]) => {
  const [X, Y, Z] = input[0].map(Number);

  const width = X - Z;

  return Math.floor(width / (Y + Z));
};

console.log(main(read()));
//  [python]
H, W = map(int, input().split())
S = [input() for _ in range(H)]
Ans = [[[-1, -1]for __ in range(W)] for _ in range(H)]
ans = 0
for i in range(H):
    for j in range(W):
        if S[i][j] == '#':
            continue
        else:
            if Ans[i-1][j][0] != -1:
                Ans[i][j][0] = Ans[i-1][j][0]
            else:
                num0 = 0
                while True:
                    num0 += 1
                    if i + num0 >= H:
                        break
                    elif S[i+num0][j] == '#':
                        break
                Ans[i][j][0] = num0

            if Ans[i][j-1][1] != -1:
                Ans[i][j][1] = Ans[i][j-1][1]
            else:
                num1 = 0
                while True:
                    num1 += 1
                    if j + num1 >= W:
                        break
                    elif S[i][j+num1] == '#':
                        break
                Ans[i][j][1] = num1

        ans = max(ans, sum(Ans[i][j]))
print(ans-1)
//  [python]
#!/usr/bin/env python3
import sys
import collections as cl


def II(): return int(sys.stdin.readline())


def MI(): return map(int, sys.stdin.readline().split())


def LI(): return list(map(int, sys.stdin.readline().split()))


def main():
    H, W = MI()
    room = [["" for j in range(W)] for i in range(H)]
    roomT = [["" for i in range(H)] for j in range(W)]
    num_yoko = [[0 for j in range(W)] for i in range(H)]
    num_tate = [[0 for j in range(W)] for i in range(H)]
    num_sum = [[0 for j in range(W)] for i in range(H)]
    for i in range(H):
        row = input()

        splited = list(map(len, row.split('#')))
        tmp = 0
        for j in range(W):
            roomT[j][i] = row[j]
            room[i][j] = row[j]
            if row[j] == "#":
                num_yoko[i][j] = 0
                tmp += 1
            else:
                num_yoko[i][j] = splited[tmp]

    ans = 0

    for j in range(W):
        target = roomT[j]
        splited = list(map(len, "".join(target).split('#')))
        tmp = 0
        for i in range(H):
            if target[i] == "#":
                num_tate[i][j] == 0
                tmp += 1
            else:
                num_tate[i][j] = splited[tmp]

            num_sum[i][j] = num_tate[i][j] + num_yoko[i][j] - 1
            ans = max(ans, num_sum[i][j])
    print(ans)


main()
//  [python]
import sys
sys.setrecursionlimit(2147483647)
 
h,w=map(int,input().split())
s=list(input() for _ in range(h))
 
yoko=[[0]*w for _ in range(h)]
tate=[[0]*w for _ in range(h)]
 
def yoko_check(y,x,cnt):
    global yoko,s
    if x==w-1:
        yoko[y][x]=cnt
        return cnt
    else:
        if s[y][x+1]=="#":
            yoko[y][x]=cnt
            return cnt
        else:
            yoko[y][x]=yoko_check(y,x+1,cnt+1)
            return yoko[y][x]
 
 
def tate_check(y,x,cnt):
    global tate,s
    if y==h-1:
        tate[y][x]=cnt
        return cnt
    else:
        if s[y+1][x]=="#":
            tate[y][x]=cnt
            return cnt
        else:
            tate[y][x]=tate_check(y+1,x,cnt+1)
            return tate[y][x]
 
 
for y in range(h):
    for x in range(w):
        if yoko[y][x]==0 and s[y][x]==".":
            yoko_check(y,x,1)
        if tate[y][x]==0 and s[y][x]==".":
            tate_check(y,x,1)
 
#print(tate)
 
result=0
for y in range(h):
    for x in range(w):
        if s[y][x]==".":
            result=max(result,tate[y][x]+yoko[y][x]-1)  
 
print(result)
//  [java]
import java.util.*;

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int H = sc.nextInt();
		int W = sc.nextInt();
		char[][] c = new char[H][W];
		int[][][] ans=new int[H][W][2];
		for (int i=0;i<H;i++) {
			String S=sc.next();
			for (int j=0;j<W;j++) {
				c[i][j]=S.charAt(j);
			}
		}
		for (int i=0;i<H;i++) {
			int left=0;
			int right=0;
			Queue<int[]> queue = new ArrayDeque<int[]>();
			for (int j=0;j<W;j++) {
				if (c[i][j]=='#') {
					ans[i][j][0]=-5000000;
					int[] tmp = {i,left,right};
					queue.add(tmp);
					right++;
					left=right;
				} else {
					if (j==W-1) {
						right++;
						int[] tmp = {i,left,right};
						queue.add(tmp);
					} else {
						right++;
					}
				}
				while (!queue.isEmpty()) {
					int[] rem=queue.remove();
					int I = rem[0];
					int Left = rem[1];
					int Right = rem[2];
					for (int k=Left;k<Right;k++) {
						ans[I][k][0]=Right-Left;
					}
				}
			}
		}
		for (int j=0;j<W;j++) {
			int left=0;
			int right=0;
			Queue<int[]> queue = new ArrayDeque<int[]>();
			for (int i=0;i<H;i++) {
				if (c[i][j]=='#') {
					ans[i][j][1]=-5000000;
					int[] tmp = {j,left,right};
					queue.add(tmp);
					right++;
					left=right;
				} else {
					if (i==H-1) {
						right++;
						int[] tmp = {j,left,right};
						queue.add(tmp);
					} else {
						right++;
					}
				}
				while (!queue.isEmpty()) {
					int[] rem=queue.remove();
					int J = rem[0];
					int Left = rem[1];
					int Right = rem[2];
					for (int k=Left;k<Right;k++) {
						ans[k][J][1]=Right-Left;
					}
				}
			}
		}

		int[][] ans_2 = new int[H][W];
		int Ans=0;
		for (int i=0;i<H;i++) {
			for (int j=0;j<W;j++) {
				ans_2[i][j]=ans[i][j][0]+ans[i][j][1];
				Ans=Math.max(Ans,ans_2[i][j]);
			}
		}
		System.out.println(Ans-1);
	}
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
//C++ as C#
#define var auto
#define Max std::max
#define Min std::min
template<typename T1, typename T2> inline void chmin(T1& a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1& a, T2 b) { if (a < b) a = b; }

#ifdef _MSC_VER
#define getchar_unlocked getchar
#define putchar_unlocked putchar
#define fseek_unlocked fseek
#endif

inline uint32_t read()
{
	uint32_t x = 0;
	int k;
	while (true)
	{
		k = getchar_unlocked();
		if (k < '0') break;
		x = x * 10 + k - '0';
	}
	return x;
}

void writeline(uint32_t x) {
	int s = 0;
	char f[8];
	while (x) {
		f[s++] = x % 10;
		x /= 10;
	}
	while (s--)
		putchar_unlocked(f[s] + '0');
	putchar_unlocked('\n');
}

int main()
{
	int h = read(), w = read();
	int columnAccum[2000] = {};
	int rowMax[2000] = {};
	int max = 0;
	for (size_t i = 0; i < h; i++)
	{
		int currentChain = 0;
		for (size_t j = 0; j < w; j++)
		{
			var c = getchar_unlocked() & 1;
			if (c) 
			{
				max = Max(max, columnAccum[j] + rowMax[j]);
				for (size_t k = j - currentChain; k < j; k++)
					rowMax[k] = Max(rowMax[k], currentChain);
				currentChain = 0;
				rowMax[j] = 0;
				columnAccum[j] = 0;
			}
			else 
			{
				currentChain++;
				columnAccum[j]++;
			}
		}
		for (size_t j = w - currentChain; j < w; j++)
			rowMax[j] = Max(rowMax[j], currentChain);
		getchar_unlocked();
	}
	for (size_t i = 0; i < w; i++)
		max = Max(max, columnAccum[i] + rowMax[i]);
	writeline(max - 1);
	return 0;
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
#define var auto
#define Max std::max
#define Min std::min

#ifdef _MSC_VER
#define getchar_unlocked getchar
#define putchar_unlocked putchar
#define fseek_unlocked fseek
#endif

inline int read()
{
	int x = 0;
	int k;
	while (true)
	{
		k = getchar_unlocked();
		if (k < '0') break;
		x = x * 10 + k - '0';
	}
	return x;
}

void writeline(int x) {
	int s = 0;
	char f[8];
	while (x) {
		f[s++] = x % 10;
		x /= 10;
	}
	while (s--)
		putchar_unlocked(f[s] + '0');
	putchar_unlocked('\n');
}

#pragma GCC optimize ("-O3")
int main()
{
	int h = read(), w = read();
	int columnAccum[2000] = {};
	int rowMax[2000] = {};
	int max = 0;
	for (int i = 0; i < h; i++)
	{
		int currentChain = 0;
		for (int j = 0; j < w; j++)
		{
			var c = getchar_unlocked() & 1;
			if (c)
			{
				max = Max(max, columnAccum[j] + rowMax[j]);
				for (int k = j - currentChain; k < j; k++)
					rowMax[k] = Max(rowMax[k], currentChain);
				currentChain = 0;
				rowMax[j] = 0;
				columnAccum[j] = 0;
			}
			else
			{
				currentChain++;
				columnAccum[j]++;
			}
		}
		getchar_unlocked();
		for (int j = w - currentChain; j < w; j++)
			rowMax[j] = Max(rowMax[j], currentChain);
	}
	for (int i = 0; i < w; i++)
		max = Max(max, columnAccum[i] + rowMax[i]);
	writeline(max - 1);
	return 0;
}
//  [cpp]
#include <iostream>
#include <string>
#include <vector>
#include<algorithm>
#include <set>

using namespace std;

int H, W;
string S[2020];
set<int> V[2020], Y[2020];

int main(void) {

	cin >> H >> W;

	for (int i = 0; i <= W + 1; i++) {
		S[0] += "#";
		S[H + 1] += "#";
	}

	string  tmp;
	for (int i = 1; i <= H; i++) {
		cin >> tmp;
		S[i] = "#" + tmp + "#";
	}

	/*for (int i = 0; i <= H + 1; i++) {
		cout << S[i] << endl;
	}*/

	for (int i = 1; i <= H; i++) {
		for (int j = 0; j <= W + 1; j++) {
			if (S[i][j] == '#') { V[i].insert(j); }
		}
	}

	for (int j = 1; j <= W; j++) {
		for (int i = 0; i <= H + 1; i++) {
			if (S[i][j] == '#') { Y[j].insert(i); }
		}
	}

	long long int ans = 0;

	for (int i = 1; i <= H; i++) {
		for (int j = 1; j <= W; j++) {
			if (S[i][j] == '#') { continue; }
			//==============
			V[i].insert(j);
			auto it1 = V[i].find(j);
			it1--;
			auto it2 = V[i].find(j);
			it2++;
			V[i].erase(j);
			//===============

			Y[j].insert(i);
			auto itt1 = Y[j].find(i);
			itt1--;
			auto itt2 = Y[j].find(i);
			itt2++;
			Y[j].erase(i);
			//=============

			long long int num = (*it2) - (*it1) - 1 + (*itt2) - (*itt1) - 1 - 1;
			/*cout << "i= " << i << "  j= " << j << endl;
			cout << *it1 << " " << *it2 << endl;
			cout << *itt1 << "  " << *itt2 << endl;
			cout<<"num = " << num << endl;*/
			ans = max(ans, num);
		}
	}

	cout << ans << endl;

	return 0;
}
//  [cpp]
#include<bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef pair<int, int> pi;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<pi> vpi;

#define debugone(x) cout << #x << " " << x << endl;
#define debugtwo(x) cout << #x << "-------------" << endl;for(auto &it: x) cout << it << " ";cout << endl;
#define debugthree(x, i, j) cout << #x << "------------" << endl;cout << "from " << i << " to " << j << endl;for(int k=i; k<=j; k++) cout << x[k] << " ";cout << endl;

const int mod = (int)1e9 + 7;

int main(int argc, char *argv[]){
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	int h, w;
	cin >> h >> w;
	vector<vector<bool>> obstacle(h+1, vector<bool> (w+1));

	vector<vector<int>> rows(h+1), cols(w+1);

	


	for(int row = 1; row <=h; row++){
		rows[row].push_back(0);
	}

	for(int col = 1; col <= w; col++){
		cols[col].push_back(0);
	}


	for(int i=1; i<=h; i++){
		for(int j=1; j<=w; j++){
			char ch;
			cin >> ch;
			if(ch == '#'){
				obstacle[i][j] = true;
				rows[i].push_back(j);
				cols[j].push_back(i);
			} 
			else obstacle[i][j] = false;
		}
	}

	for(int row = 1; row <=h; row++){
		rows[row].push_back(w+1);
	}

	for(int col = 1; col <= w; col++){
		cols[col].push_back(h+1);
	}

	int maxi = 0;

	for(int r = 1; r <= h; r++){
		for(int c = 1; c <= w; c++){
			cerr << (obstacle[r][c] ? '#' : '.');
		}
		cerr << endl;
	}


	for(int i = 1; i <= h; i++){
		for(int j = 1; j <= w; j++){
			if(!obstacle[i][j]){
				int totalLight = 0;
				int id = lower_bound(rows[i].begin(), rows[i].end(), j) - rows[i].begin();
				totalLight += rows[i][id] - rows[i][id-1] - 1;
				id = lower_bound(cols[j].begin(), cols[j].end(), i) - cols[j].begin();
				totalLight += cols[j][id] - cols[j][id-1] - 2;
				maxi = max(totalLight, maxi);
			}
		}
	}

	cout << maxi << endl;
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

using ll = long long;

const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
int hor[2100][2100];


int main() {
  int H, W;
  cin >> H>>W;
  vector<string> field(H);
  for(int i = 0; i < H; i++) {
    cin>>field[i];
  }
  int ans=0;
  bool M = false;
  for(int i = 0; i < H; i++) {
    for(int j = 0; j < W; j++) {
      if(field[i][j]=='#') continue;
      int cnt = 0;
      int k = 0;
      if(j==0||field[i][j-1]=='#'){
        while(j+k<W){
          if(field[i][j+k]=='.') hor[i][j]++;
          if(field[i][j+k]=='#') break;
          k++;
        }
        k=0;
        while(j+k>=0){
          if(field[i][j+k]=='.') hor[i][j]++;
          if(field[i][j+k]=='#') break;
          k--;
        }
      }
      else hor[i][j] = hor[i][j-1];
      k=0;
      while(i+k<H){
        if(field[i+k][j]=='.') cnt++;
        if(field[i+k][j]=='#') break;
        k++;
      }
      k=0;
      while(i+k>=0){
        if(field[i+k][j]=='.') cnt++;
        if(field[i+k][j]=='#') break;
        k--;
      }
      cnt+=hor[i][j];
      cnt-=3;
      chmax(ans,cnt);
      if (ans == H+W-1){
        M = true;
        break;
      }
    }
    if(M) break;
  }
  cout<<ans<<endl;
}
//  [c]
#include <stdio.h>

inline static int read_int() {
    int x = 0, k;
    while ((k = getchar_unlocked() - '0') >= 0) {
        x = x * 10 + k;
    }
    return x;
}

inline static void put_int(int x) {
    int s = 0;
    char f[4];
    while (x) {
        f[s++] = x % 10;
        x /= 10;
    }

    while (s--) putchar_unlocked(f[s] + '0');
    putchar_unlocked('\n');
}

int highest[2000], streak[2000];

#pragma GCC optimize ("O3")
int main() {
    int h = read_int(), w = read_int(), max = 0, height, width, lastWall, i, res;
    short len;

    for (height = 0; height < h; height++) {
        lastWall = -1;

        for (width = 0; width < w; width++) {
            if (getchar_unlocked() != '.') {
                if (lastWall != width - 1) {
                    len = width - lastWall - 1;
                    for (i = lastWall + 1; i < width; i++) if (len > highest[i]) highest[i] = len;
                }

                res = highest[width] + streak[width];
                if (res > max) max = res;

                highest[width] = streak[width] = 0;
                lastWall = width;
            } else streak[width]++;
        }

        getchar_unlocked();

        if (lastWall != width - 1) {
            len = width - lastWall - 1;
            for (i = lastWall + 1; i < width; i++) if (len > highest[i]) highest[i] = len;
        }
    }

    for (width = 0; width < w; width++) {
        if (streak[width] != 0) {
            res = highest[width] + streak[width];
            if (res > max) max = res;
        }
    }

    put_int(max - 1);
}
//  [c]
#include <stdio.h>

inline static int read_int() {
    int x = 0, k;
    while ((k = getchar_unlocked() - '0') >= 0) {
        x = x * 10 + k;
    }
    return x;
}

inline static void put_int(int x) {
    int s = 0;
    char f[4];
    while (x) {
        f[s++] = x % 10;
        x /= 10;
    }

    while (s--) putchar_unlocked(f[s] + '0');
    putchar_unlocked('\n');
}

short highest[2000], streak[2000];

#pragma GCC optimize ("O3")
int main() {
    int h = read_int(), w = read_int(), max = 0, height, width, lastWall, i, res;
    short len;

    for (height = 0; height < h; height++) {
        lastWall = -1;

        for (width = 0; width < w; width++) {
            if (getchar_unlocked() != '.') {
                if (lastWall != width - 1) {
                    len = width - lastWall - 1;
                    for (i = lastWall + 1; i < width; i++) if (len > highest[i]) highest[i] = len;
                }

                res = highest[width] + streak[width];
                if (res > max) max = res;

                highest[width] = streak[width] = 0;
                lastWall = width;
            } else streak[width]++;
        }

        getchar_unlocked();

        if (lastWall != width - 1) {
            len = width - lastWall - 1;
            for (i = lastWall + 1; i < width; i++) if (len > highest[i]) highest[i] = len;
        }
    }

    for (width = 0; width < w; width++) {
        if (streak[width] != 0) {
            res = highest[width] + streak[width];
            if (res > max) max = res;
        }
    }

    put_int(max - 1);
}