jiahuimbzuai/CoQuIR huggingface dataset:
//  [javascript]
"use strict"
const create = () => {
    const input = require("fs").readFileSync("/dev/stdin", "utf8").trim().split("\n");
    const res = {
        "list": input, "index": 0, "max": input.length,
        "hasNext": function () { return this.index < this.max },
        "next": function () { if (!this.hasNext()) { throw "ArrayIndexOutOfBoundsException"; } else { return this.list[this.index++]; } }
    };
    return res;
}
const o = create();
const next = () => o.next()
const nextInt = () => parseInt(o.next())
const nextStrArray = () => o.next().split(" ")
const nextIntArray = () => o.next().split(" ").map(el => parseInt(el))
const nextCharArray = () => o.next().split("")
const hasNext = () => o.hasNext()
const myout = (...x) => console.log(...x)
const Main = () => {
    let [h, w] = next().split(" ").map(el => BigInt(el))
    let first, second
    let firstRow, secondRow
    if (w % 2n == 0n) {
        first = w / 2n
        second = w / 2n
    } else {
        first = w / 2n + 1n
        second = w / 2n
    }
    if (h % 2n == 0n) {
        firstRow = h / 2n
        secondRow = h / 2n
    } else {
        firstRow = h / 2n + 1n
        secondRow = h / 2n
    }
    console.log((first * firstRow + second * secondRow).toString())
}
Main()
//  [javascript]
'use strict'

const Main = (input) => {
  const tmp = input.trim().split(' ')
  const H = parseInt(tmp[0])
  const W = parseInt(tmp[1])

  let result = 0

  if ((H % 2) != 0 && (W % 2) != 0) {
    result = Math.ceil(H * W / 2)
  } else {
    result = H * W / 2
  }

  console.log(result)
  return result
}

Main(require('fs').readFileSync('/dev/stdin', 'utf8'))
//  [javascript]
process.stdin.resume();
process.stdin.setEncoding('utf8');

var lines = []
var reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});

reader.on('line', (line) => {
  lines.push(line);
});

reader.on('close', () => {
 var hw = lines[0].split(' ');
 var h = Number(hw[0]);
 var w = Number(hw[1]);
 var ans = 0;
 if((h * w) % 2 == 0){
   ans = h*w / 2;
 }else{
   ans = Math.round(h*w / 2);   
 }
 
 console.log(ans);
});
//  [go]
package main

import "fmt"

func main() {
	var h, w int
	fmt.Scan(&h, &w)

	if h == 1 || w == 1{
		fmt.Println(1)
	}else{
		fmt.Println((h * w + 1) / 2 )
	}


}
//  [go]
package main

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

func main() {
	var wtr = bufio.NewWriter(os.Stdout)
	var scanner = bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanLines)
	var W, H int
	if scanner.Scan() {
		str := scanner.Text()
		cols := strings.Split(str, " ")
		H, _ = strconv.Atoi(cols[0])
		W, _ = strconv.Atoi(cols[1])

	}
	var ans int

	if H == 1 || W == 1 {
		ans = 1
	} else {
		p := H * W
		if p%2 == 1 {
			ans = p/2 + 1
		} else {
			ans = p / 2
		}
	}

	fmt.Fprintln(wtr, ans)
	_ = wtr.Flush()
}
//  [go]
package main

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

var H, W int

func main() {
	sc.Split(bufio.ScanWords)
	H, W = nextInt(), nextInt()

	if H == 1 || W == 1 {
		fmt.Println(1)
		return
	}
	fmt.Println(W*(H/2) + (H%2)*((W+1)/2))

}
//  [go]
package main

import "fmt"

func main() {
	var h, w, ans int64
	fmt.Scan(&h, &w)
	if w == 1 && h == 1 {
		ans = 1
	} else {
		ans = ((w+1)/2)*((h+1)/2) + (w/2)*(h/2)
	}
	fmt.Println(ans)
}
//  [go]
package main

import "fmt"

func main() {
	var h, w, ans int
	fmt.Scan(&h, &w)
	if w == 1 && h == 1 {
		ans = 1
	} else {
		ans = ((w+1)/2)*((h+1)/2) + (w/2)*(h/2)
	}
	fmt.Println(ans)
}
//  [go]
package main

import "fmt"

func main() {
	var h, w, ans int
	fmt.Scan(&h, &w)
	if w%2 == 0 {
		ans = w / 2 * h
	} else {
		ans = ((w+1)/2)*((h+1)/2) + (w/2)*(h/2)
	}
	fmt.Println(ans)
}
//  [ruby]
line = gets.split(' ').map(&:to_i)

H = line[0]
W = line[1]

if H == 1 or W == 1 then
  print 1
elsif H % 2 == 0 or W % 2 == 0 then
  print H * W / 2
else
  print (H * W + 1) / 2
end
//  [ruby]
h, w = gets.chomp.split(" ").map(&:to_i)
if h == 1 || w == 1  then
	puts 1
elsif h.even? || w.even?
	puts h * w / 2
else
	puts h * w / 2 + 1
end
//  [ruby]
h, w = gets.chomp.split.map(&:to_i)
puts (h == 1 || w == 1)? "1" : (h * w + 1) / 2
//  [ruby]
h,w=gets.split.map(&:to_i)

if h==1 || w==1
    puts 1
end

sum=0
if h%2==0
    puts h/2*w
else
    puts h/2*w+(w+2-1)/2
end
//  [ruby]
H, W = gets.split.map &:to_i
if h == 1 || w == 1
  puts 1
else
  puts (H * W / 2.0 ).ceil
end
//  [ruby]
H, W = gets.split.map &:to_i
if h == 1 || w == 1
  puts 1
else
  puts (H * W / 2.0 ).ceil
//  [rust]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

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

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

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

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

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

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

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}
fn adjacent4(x: usize, y: usize, sx: usize, sy: usize) -> Vec<(usize, usize)> {
    [(-1, 0), (1, 0), (0, -1), (0, 1)]
        .into_iter()
        .filter_map(|&(dx, dy)| {
            let nx = x as isize + dx;
            let ny = y as isize + dy;
            if nx >= 0 && nx < sx as isize && ny >= 0 && ny < sy as isize {
                Some((nx as usize, ny as usize))
            } else {
                None
            }
        })
        .collect()
}

#[allow(unused_imports)]
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};
fn main() {
    input! {
        h: u64,
        w: u64,
    }
    // マスの目はh * w
    if h == 1 || w == 1 {
        println!("{}", 1);
    } else {
        println!("{}", (h * w + 1) / 2);
    }
}
//  [rust]
struct Read<R: std::io::BufRead> {
    stdin: R,
    v: Vec<String>,
    i: usize,
}
impl<R:std::io::BufRead> Read<R> {
    pub fn new(stdin: R) -> Self {
        Read{
            stdin: stdin,
            v: Vec::new(),
            i: 0,
        }
    }
    pub fn read_until<T: std::str::FromStr>(&mut self) -> T {
        if self.i == self.v.len() {self.read_line();}
        let elem = &self.v[self.i];
        self.i += 1;
        elem.parse().unwrap_or_else(|_| panic!())
    }
    pub fn read_line(&mut self) {
        self.i = 0; self.v.clear();
        let mut buf = String::new();
        self.stdin.read_line(&mut buf).unwrap();
        let buf = buf.trim().to_owned();
        let mut ws = buf.split_whitespace();
        loop {
            let x = ws.next();
            if x.is_none() {break;}
            let x = x.unwrap().to_owned();
            self.v.push(x);
        }
    }
    #[allow(dead_code)]
    pub fn read_i32(&mut self) -> i32 {
        if self.i == self.v.len() {self.read_line();}
        let elem = self.v[self.i].parse().unwrap();
        self.i += 1;
        elem
    }
    #[allow(dead_code)]
    pub fn read_string(&mut self) -> String {
        if self.i == self.v.len() {self.read_line();}
        let elem = &self.v[self.i];
        self.i += 1;
        elem.to_owned()
    }
}
fn main() {
    use std::io;
    let stdin = io::stdin();
    let stdin = io::BufReader::new(stdin.lock());
    let read = Read::new(stdin);
    solve(read);
}

fn solve<R: std::io::BufRead>(mut r: Read<R>) {
    let h:u64 = r.read_until();
    let w:u64 = r.read_until();
    let s = h * w;
    if h!=1 && w!=1 {
        println!("{}",if s%2 == 1 {
            s/2+1
        }else{
            s/2
        });
    } else {
        println!("1");
    }
}
//  [rust]
use std::io::*;
use std::str::FromStr;

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 h: u64 = read();
    let w: u64 = read();
    if h == 1 {
        println!("{}", 1);
    } else if w == 1 {
        println!("{}", 1);
    } else {
        let odd = ((w + 1) / 2) * ((h + 1) / 2);
        let even = (w / 2) * (h / 2);
        println!("{}", odd + even);
    }
}
//  [rust]
use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("filed 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 h:u128 = read();
    let w:u128 = read();
    println!("{}", w * (h / 2) + std::cmp::min(w, w/2 + w % 2) * (h % 2));
}
//  [rust]
use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("filed 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 h:usize = read();
    let w:usize = read();
    println!("{}", w * (h / 2) + (w/2 + w % 2) * (h % 2));
}
//  [rust]
use proconio::{fastout, input};

#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::*;

#[fastout]
fn main() {
    input! {
        h: usize,
        w: usize,
    }

    let mut ans = 0;
    ans += (h / 2) * w;
    ans += (w / 2 + w % 2) * (h % 2);
    println!("{}", ans);
}
//  [swift]
import Foundation

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

func main() {
    let hw = readInts()
    let (h, w) = (hw[0], hw[1])
    if h == 1 || w == 1 {
        print(1)
        return
    }
    let multiplied = h * w
    print(multiplied.isMultiple(of: 2) ? multiplied / 2: multiplied / 2 + 1)
}

main()
//  [swift]
import Foundation

let HW = readLine()!.components(separatedBy: " ")

let H = Int(HW[0])!
let W = Int(HW[1])!

let (W1, _) = W.quotientAndRemainder(dividingBy: 2)
let (W2, _) = (W+1).quotientAndRemainder(dividingBy: 2)

if (H == 1 || W == 1) {
    print(1)
} else if (H % 2 == 0) {
    let HH = UInt64(H/2)
    print(HH*UInt64(W1+W2))
} else {
    let HH = UInt64((H-1)/2)
    print(HH*UInt64(W1+W2) + UInt64(W2))
}
//  [swift]
import Foundation

let HW = readLine()!.components(separatedBy: " ")

let H = Int(HW[0])!
let W = Int(HW[1])!

let (W1, _) = W.quotientAndRemainder(dividingBy: 2)
let (W2, _) = (W+1).quotientAndRemainder(dividingBy: 2)

if (H % 2 == 0) {
    let HH = UInt64(H/2)
    print(HH*UInt64(W1+W2))
} else {
    let HH = UInt64((H-1)/2)
    print(HH*UInt64(W1+W2) + UInt64(W2))
}
//  [swift]
import Foundation

let HW = readLine()!.components(separatedBy: " ")

let H = Int(HW[0])!
let W = Int(HW[1])!

let W1 = Int((Double(W)/2).rounded(.down))
let W2 = Int((Double(W)/2).rounded(.up))

if (H % 2 == 0) {
    let HH = UInt64(H/2)
    print(HH*UInt64(W1+W2))
} else {
    let HH = UInt64((H-1)/2)
    print(HH*UInt64(W1+W2) + UInt64(W2))
}
//  [swift]
import Foundation

let HW = readLine()!.components(separatedBy: " ")

let H = Int(HW[0])!
let W = Int(HW[1])!

let W1 = Int((Double(W)/2).rounded(.down))
let W2 = Int((Double(W)/2).rounded(.up))

if (H % 2 == 0) {
    let HH = Int(H/2)
    print(HH*(W1+W2))
} else {
    let HH = Int((H-1)/2)
    print(HH*(W1+W2) + W2)
}
//  [typescript]
function main(input) {
    const lines = input.split("\n");
    const [H, W] = lines[0].split(' ');
    
    console.log((H == 1 || W == 1) ? 1 :Math.ceil(H*W/2));
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [typescript]
export class Main {
  static main(input: string): string {
    const tmp: string[] = input.split("\n");
    const [h, w]: number[] = tmp.shift().split(" ").map(int => parseInt(int));
    return `${h == 1 || w == 1 ? 1 : Math.ceil(h * w / 2)}`;
  }
}
console.log(Main.main(require("fs").readFileSync("/dev/stdin", "utf8")));
//  [typescript]
// inputに入力データ全体が入る
// @ts-ignore
const main = (input: string) => {
  const [h, w] = input.split(' ').map(v=>Number(v));

  if (h === 1 || w === 1) {
    console.log(1);
    return;
  }
  console.log(Math.round(h*w/2));
}

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

if A>=10 or B>=10:
 print("-1")
else:
 print(A*B)
//  [python]
a, b = map(int, input().split())
ans = a * b
if max(a, b) >= 10:
    ans = -1
print(ans)
//  [python]
x,y=map(int,input().split())
if x>=10 or y>=10:
  print(-1)
else:
  print(x*y)
//  [python]
n = int(input())
for i in range(1,10):
    for j in range(1,10):
        if(i*j==n):
            print("Yes")
            exit()
print("No")
//  [python]
a = int(input());
b = int(input());

if (a >= 1 and a <= 9 and b >= 1 and b <= 9):
  print(a*b)
else:
  print("-1")
//  [python]
a, b = map(int,input().split())

if a * b > 81:
    print(-1)
else:
    print(a * b)
//  [java]
import java.io.IOException;
import java.io.InputStream;
import java.util.*;
import java.lang.Math;

public class Main {
    public static void main(String[] args) {
        FS reader = new FS();
        // write reader
        int A = reader.nextInt();
        int B = reader.nextInt();
        int ans = A<10 && B<10 ? A*B : -1;
        System.out.println(ans);
    }

    public static long[][] warshall(int n, long[][]matrix) {
        long[][] ans = matrix;
        for(int i=0; i<n; i++) {
            ans[i][i] = 0;
        }
        for(int i=0; i<n; i++) {
            for(int j=0; j<n; j++) {
                for(int k=0; k<n; k++) {
                    ans[j][k] = Math.min(ans[j][k], ans[j][i]+ans[i][k]);
                }
            }
        }
        return ans;
    }

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

import java.util.*;
import java.io.*;
class Main {
    public static void main(String[] args) {
        FastScanner sc = new FastScanner();
        int n = sc.nextInt();
        int m = sc.nextInt();
        if(n<10 && m<10) p(n*m);
    	else p(-1);
    }
    public static <T> void p(T element) {
	System.out.println(element);
    }
    public static int min(int a, int b, int c) {
	int min = Math.min(a,b);
	min = Math.min(min,c);
	return min;
    }
    public static int max(int a, int b,int c) {
	int max= Math.max(a,b);
	max = Math.max(max,c);
        return max;
    }
}
class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        } else {
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
 
    private int readByte() {
        if (hasNextByte())
            return buffer[ptr++];
        else
            return -1;
    }
 
    private boolean isPrintableChar(int c) {
        return 33 <= c && c <= 126;
    }
 
    public boolean hasNext() {
        while (hasNextByte() && !isPrintableChar(buffer[ptr]))
            ptr++;
        return hasNextByte();
    }
 
    public String next() {
        if (!hasNext())
            throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while (isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
 
    public long nextLong() {
        if (!hasNext())
            throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while (true) {
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            } else if (b == -1 || !isPrintableChar(b)) {
                return minus ? -n : n;
            } else {
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
 
    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)
            throw new NumberFormatException();
        return (int) nl;
    }
 
    public double nextDouble() {
        return Double.parseDouble(next());
    }
}
//  [java]
import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;
import java.util.NoSuchElementException;

public class Main {
	public static void main(String[] args) {
		FastScanner sc = new FastScanner();
		int A = sc.nextInt();
		int B = sc.nextInt();
		int ans = -1;
		if (A < 10 && B < 10) {
			ans = A*B;
		}
		System.out.println(ans);
	}
	
	public static long gcd(long a, long b) {
		long remainder = a % b;
		if (remainder == 0) {
			return b;
		} else {
			return gcd(b, remainder);
		}
	}
}

class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        } else {
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }

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

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

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

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

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

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

    public double nextDouble() {
        return Double.parseDouble(next());
    }
}
//  [java]
import java.util.*;

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

        if (a*b <= 81)
            System.out.println(a*b);
        else
            System.out.println(-1);
    }
}
//  [java]
import java.util.*;

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

        if (a*b <= 81)
            System.out.println(a*b);
        else
            System.out.println("-1");
    }
}
//  [java]
import java.util.Scanner;

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

}
//  [cpp]
#include<iostream>
using namespace std;
int main(){
  int a,b;cin>>a>>b;
  if(a<10&&b<10)cout<<a*b<<endl;
  else cout<<-1<<endl;
}
//  [cpp]
#include<bits/stdc++.h>
using namespace std;

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

    if(a < 10 && b < 10) cout << a * b << endl;
    else                 cout << "-1" << endl;

    return 0;
}
//  [cpp]
// Code by Nguyen Huu Lam
#include<bits/stdc++.h>
using namespace std;

typedef long long LL;
const LL MaxN = 1 + 1e5;

LL n, a[MaxN], m;

void InOut(){
    #define TASK "ABC"
    freopen(TASK".inp","r",stdin);
    freopen(TASK".out","w",stdout);
}

int main(){
    // InOut();
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    cin >> n >> m;
    if(n > 9 || m > 9){
        cout << -1 << endl;
        return 0;
    }
    cout << n * m << endl;

    return 0;
}
//  [cpp]
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;

int main(){
  int n;
  cin>>n;
  bool answer=false;
  for(int i=1;i<=9;i++){
    for(int j=1;j<=9;j++){
    	if(n==i*j) answer=true;
    } 
  }
  if(answer) printf("Yes");
  else printf("No");
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
    int a,b;
    if((a>=1 && a<=9) &&(b>=1 && b<=9) )
        cout<<a*b;
    else
        cout<<-1;
    return 0;
}
//  [c]
#include<stdio.h>
int main()
{
	int a,b;
	scanf("%d",&a);
	scanf("%d",&b);
	if(a<10&&b<10)
	printf("%d",a*b);
	else printf("-1");
	return 0;
}
//  [c]
#include <stdio.h>

int main(void){
  int a,b;

  scanf("%d %d",&a,&b);
  if (a<=9 && b<=9){
    printf("%d\n",a*b);
  }else{
    printf("-1\n");
  }
  return 0;
}
//  [c]
#include <stdio.h>

int main(){

  int	A, B;
  
  scanf("%d %d", &A, &B);

  if( (A <= 9) && (B <= 9) ){ printf("%d", A*B); }
  else						{ printf("-1"); }

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

int main()
{
    int a,b;

    scanf("%d%d",&a,&b);
    if( a>9 || b>9 || a<0 ||b<0)
        printf("-1\n");
        else
            printf("%d\n",a*b);

    return 0;
}
//  [c]
#include<stdio.h>
int main(void){
  int A,B;
  int i;
  scanf("%d%d",&A,&B);
  if(1<=A && A>=9 && 1<=B && B>=9)
    i = A*B;
  else
    i = -1;
  printf("%d",i);
  return 0;
}
//  [c]
#include<stdio.h>
int main(void){
  int A,B;
  int i;
  scanf("%d%d",&A,&B);
  if(1<=A<=9 && 1<=B<=9)
    i = A*B;
  else
    i = -1;
  printf("%d",i);
  return 0;
}
//  [javascript]
function main(arg) {
	arg = arg.trim().split(' ');
  	arg = arg.map(str => parseInt(str, 10));
  	var out = '-1';
  	if (arg[0] > 9 || arg[1] > 9) {
		console.log(out);    
    } else {
    	out = arg[0] * arg[1]
      	console.log(out);
    }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
function main(arg) {
	arg = arg.trim().split(' ');
  	arg = arg.map(str => parseInt(str, 10));
  	var out = '-1';
  	if (arg[0] > 9) {
		console.log(out);    
    } else if(arg[1] > 9) {
    	console.log(out);
    } else {
    	out = arg[0] * arg[1]
      	console.log(out);
    }
  	//arg.forEach(ele => out = ele > 9 ? '-1' : false);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
function Main(input) {
		input = input.split(" ");
		const num1 = parseInt(input[0], 10);
		const num2 = parseInt(input[1], 10);
		console.log( ( 0 < num1 && num1 < 10) &&  ( 0 < num2 && num2 < 10)  ?  num1 * num2 : -1);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main(input) {
    var args = input.trim().split(' ').map(Number);
    if(!args[0] <= 9 && args[1] <= 9) {
      console.log(args[0] * args[1]);
    } else {
      console.log("'-1'");
    }
 }
 
/* var input = `10 10`;
Main(input);
 */ 
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main(input) {
    var args = input.trim().split(' ').map(Number);
    if(!args[0] <= 9 && args[1] <= 9) {
      console.log(args[0] * args[1]);
    } else {
      console.log('-1');
    }
 }
 
/* var input = `5 10`;
Main(input);
 */  
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main(input) {
    var args = input.trim().split(' ').map(Number);
/*     for(var i = 0; i < args.length; i++) {
      if(args[i] >= )
    } */
    if(!args[0] <= 9 && args[1] <= 9) {
      console.log(args[0] * args[1]);
    } else {
      console.log('-1');
    }
 }
 
/* var input = `5 10`;
Main(input);
 */  
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [go]
package main

import "fmt"

func main() {
	var a,b int
	fmt.Scan(&a, &b)
	if a <= 9 && b <= 9 {
		fmt.Println(a*b)
	} else {
		fmt.Println(-1)
	}
}
//  [go]
package main

import "fmt"

func main() {
	var a, b int
	fmt.Scanln(&a, &b)
	ans := -1
	if a < 10 && b < 10 {
		ans = a * b
	}
	fmt.Println(ans)
}
//  [go]
package main

import "fmt"

func main() {
	var a, b int
	fmt.Scan(&a, &b)
	if a <= 9 || b <= 9 {
		fmt.Println(-1)
	} else {
		fmt.Println(a * b)
	}
}
//  [go]
package main

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

func main() {
	AB := sc.nextInts()
	if AB[0] >= 10 || AB[1] >= 10 {
		fmt.Println(-1)
	}
	fmt.Println(AB[0] * AB[1])
}

var (
	sc scanner
)

func init() {
	sc = scanner{
		buf: make([]string, 0, 0),
		cur: 0,
		r:   bufio.NewReader(os.Stdin),
	}
}

type scanner struct {
	buf []string
	cur int
	r   *bufio.Reader
}

func (s *scanner) readln() {
	rbuf := make([]byte, 0, 0)
	for {
		line, prefix, err := s.r.ReadLine()
		if err != nil {
			panic(err)
		}
		rbuf = append(rbuf, line...)
		if prefix == false {
			break
		}
	}
	s.cur = 0
	s.buf = strings.Split(*(*string)(unsafe.Pointer(&rbuf)), " ")
}
func (s *scanner) isFull() bool {
	if s.cur == len(s.buf) {
		return true
	}
	return false
}
func (s *scanner) resetCur() {
	s.cur = 0
}
func (s *scanner) next() string {
	if s.cur == 0 {
		s.readln()
	}
	res := s.buf[s.cur]
	s.cur++
	if s.isFull() {
		s.resetCur()
	}
	return res
}
func (s *scanner) nexts() []string {
	s.readln()
	s.resetCur()
	return s.buf
}
func (s *scanner) nextInt() int {
	if s.cur == 0 {
		s.readln()
	}
	res, _ := strconv.Atoi(s.buf[s.cur])
	s.cur++
	if s.isFull() {
		s.resetCur()
	}
	return res
}
func (s *scanner) nextInts() []int {
	s.readln()
	res := make([]int, len(s.buf))
	for i := range s.buf {
		res[i], _ = strconv.Atoi(s.buf[i])
	}
	s.resetCur()
	return res
}
func (s *scanner) nextFloat() float64 {
	if s.cur == 0 {
		s.readln()
	}
	res, _ := strconv.ParseFloat(s.buf[s.cur],
		64)
	s.cur++
	if s.isFull() {
		s.resetCur()
	}
	return res
}
func (s *scanner) nextFloats() []float64 {
	s.readln()
	res := make([]float64, len(s.buf))
	for i := range s.buf {
		res[i], _ = strconv.ParseFloat(s.buf[i],
			64)
	}
	s.resetCur()
	return res
}
func digits(x int) int {
	return len(strconv.Itoa(x))
}
func powInt(x, p int) (result int) {
	result = 1
	for i := 0; i < p; i++ {
		result *= x
	}
	return
}
func max(x, y int) int {
	return int(math.Max(float64(x), float64(y)))
}
func min(x, y int) int {
	return int(math.Min(float64(x), float64(y)))
}
func abs(x int) int {
	return int(math.Abs(float64(x)))
}
func varDump(value ...interface{}) {
	for _, v := range value {
		fmt.Fprintf(os.Stderr, "%#v\n", v)
	}
}
func yes() {
	fmt.Println("Yes")
}
func no() {
	fmt.Println("No")
}

// Pair a
type Pair struct {
	first  int
	second int
}

// Queue a
type Queue struct {
	v []Pair
}

// Push for queue
func (q *Queue) Push(v Pair) {
	q.v = append(q.v, v)
}

// Pop for queue
func (q *Queue) Pop() Pair {
	r := q.v[0]
	q.v = q.v[1:]
	return r
}

// Front for queue
func (q Queue) Front() Pair {
	return q.v[0]
}

// Empty return true if empty
func (q Queue) Empty() bool {
	return len(q.v) == 0
}
//  [go]
package main

import "fmt"

func main() {
	var n int
	fmt.Scan(&n)
	for i := 1; i <= 9; i++ {
		for j := 1; j <= 9; j++ {
			if i*j == n {
				fmt.Println("Yes")
				return
			}
		}
	}
	fmt.Println("No")
}
//  [ruby]
a,b=gets.split.map(&:to_i)
p a >=10 || b >=10 ? -1 : a*b
//  [ruby]
a, b = gets.split.map &:to_i
puts a > 9 || b > 9 ? -1 : a*b
//  [ruby]
line = gets.split(' ').map(&:to_i)

A = line[0]
B = line[1]

if A >= 10 or B >= 10 then
  print -1
else
  print A * B
end
//  [ruby]
a,b = gets.chomp.split(' ').map(&:to_i)
if a < 10 && b < 10
  puts a + b
else
  puts -1
end
//  [ruby]
a,b = gets.split.map(&:to_i)
puts a < 10 && b < 10 ? 'Yes':'-1'
//  [ruby]
a,b = gets.split.map(&:to_i)
puts (0..9).include? a && (0..9).include? b ? a*b : -1
//  [rust]
/* {{{ */
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

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

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

fn main() {
    input! {
        a: i32,
        b: i32
    }
    println!("{}", if a < 10 && b < 10 {a * b} else { -1 });
}
/* vim:set foldmethod=marker: */
//  [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 a = v[0];
	let b = v[1];
	if a <= 9 && b <= 9 {
		println!("{}", a*b);
	}else{
		println!("-1");
	}
}
//  [rust]
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

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

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

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

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

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

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

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

fn f(s: &[char]) -> bool {
    let m = s.len();
    for i in 0..m {
        if s[i] != s[m - 1 - i] {
            return false;
        }
    }
    true
}

use std::iter::Iterator;

fn main() {
    input! {
        n:usize,
    }

    let mut ans = false;

    for elem in 1..10 {
        if n / elem < 10 {
            ans = true;
        }
    }

    if ans {
        println!("Yes")
    }else{
        println!("No")
    }

}
//  [swift]
func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}
    
let ab = readInts()
let a = ab[0]
let b = ab[1]
if (1<=a)&&(a<=9)&&(1<=b)&&(b<=9){
  print(a*b)
}else{
  print(-1)
}
//  [swift]
func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}
 
let num=readInts()
let a=num[0]
let b=num[1]

if a>9||b>9{
  print(-1)
}else{
  print(a*b)
}
//  [swift]
let arr=readLine()!.characters.split{$0==" "}.map{Int(String($0))!}

let a : Int = arr[0]
let b : Int = arr[1]

func is1to9( number: Int ) -> Bool {
  if( number >= 1 && number <= 9 ) {
    return true
  } else {
    return false
  }
}

if( is1to9(a) && is1to9(b) ) {
  print( a * b )
} else {
  print( "-1" )
}
//  [swift]
func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}
    
let ab = readInts()
let a = ab[0]
let b = ab[1]
if (1<=a<=9)&&(1<=b<=9){
  print(a*b)
}else{
  print(-1)
}
//  [swift]
if A < 10 && B < 10 {
  return A * B
} else {
  return -1
}
//  [swift]
let input_line = readLine()!.characters.splits(" ")
let a = input_line[0]
let b = input_line[1]
if a > 9 || b > 9 {
	print("-1")
} else {
	print("\(a * b)")
}
//  [typescript]
function main(input: string[]): void {
    const a = shi(input);
    const b = shi(input);
    if (9 < a || 9 < b) {
        puts(-1);
    } else {
        puts(a * b);
    }
}

// === BEGIN MODULE ===
function shi(array: string[]): number {
    return parseInt(array.shift());
}
function shf(array: string[]): number {
    return parseFloat(array.shift());
}
function puts(...message: any[]): void {
    process.stdout.write(message.join(' ') + '\n');
}
// === END   MODULE ===

import { readFileSync } from 'fs';
if (process.argv[1] == __filename) {
    const path = process.argv[2] || '/dev/stdin';
    const input = readFileSync(path, 'utf-8');
    main(input.split(/\s+/));
}
//  [typescript]
import * as fs from "fs";

const input = (fs.readFileSync("/dev/stdin", "utf8") as string).split("\n");
//const n = +input[0];
//const a = [];
//for(let i=0;i<n;i++){
//	a.push(input[i+1].split(" ").map((x:string):number=>+x));
//}

//const [n, m] = input[0].split(" ").map((x: string): number => +x);
//const a = input[1].split(" ").map((x: string): number => +x);

function compareFunc(a, b){
    return a-b;
}

const [a, b]: number[] = input[0].split(' ').map((x: string): number => +x);

if(a >=10 || b>= 10){
    console.log(-1);
}else{
    console.log(a*b);
}
//  [typescript]
function main(input) {
    const [a,b] = input.split(' ').map(v => parseInt(v));
    console.log(a < 10 && b < 10 ? a*b : -1);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [typescript]
import * as fs from 'fs';

//in
//
//out
//
const main = (inp: string) => {
    const [a, b]: number[] = inp.split(' ').map(Number);

    if (a > 10 || b > 10) {
        console.log(-1);
    } else {
        console.log(a * b);
    }

};

main(fs.readFileSync('/dev/stdin', 'utf8').trim());
//  [typescript]
'use strict'
function main(input: String) {
    const [a, b] = input.split(' ').map(v => parseInt(v));
    console.log(a * b <= 81 ? a * b : -1);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [typescript]
'use strict'
function main(input: String) {
    const [a, b] = input.split(' ').map(v => parseInt(v));
    console.log(a * b >= 81 ? a * b : -1);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [python]
N = int(input())
S = input()

from math import ceil

def main():
    ans = N
    pre = S[0]
    for s in S[1:]:
        if pre == s:
            ans -= 1
        pre = s
    print(ans)
    return

if __name__ == "__main__":
    main()
//  [python]
def solve(s: str) -> int:
  ret = 0
  cur_c = None
  for c in s:
    if c != cur_c:
      ret += 1
      cur_c = c
  return ret


n = int(input().strip())
s = input().strip()

print(solve(s))
//  [python]
def T():
    N=int(input())
    c=''
    t=0
    for s in input():
        if s==c:
            N-=1
        c=s
    return(N)
print(T())
//  [python]
N = int(input())
S = input()


current = ""
ans = ""
for s in S:
    if s != current:
        current = s
        ans += s

# print(len(ans))
print(ans)
//  [python]
n=int(input())
a=input()
a=list(a)

c=0


for i in range(n-1):
    if a[i]!=a[i+1]:
        c+=1

if a[-1]!=a[-2]:
    c+=1

if c==0:
    c+=1
    
print(c)
//  [python]
n=int(input())
s=input()
ans=''
pass_count=0
for i in range(n):
  if i == (n-1):
    break
  if s[i] == s[i+1]:
    pass_count+=1
    pass
  else:
    ans=ans+s[i]
    if i==(n-2):
      ans+=s[i+1]
if pass_count == n-1:
  print('1')
else:
  print(len(ans))
//  [java]
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.DataInputStream;
import java.io.IOException;
import java.io.FileInputStream;
import java.io.InputStream;

/**
 * Built using CHelper plug-in Actual solution is at the top
 *
 * @author MaxHeap
 */
public class Main {

  public static void main(String[] args) {
    InputStream inputStream = System.in;
    OutputStream outputStream = System.out;
    InputReader in = new InputReader(inputStream);
    PrintWriter out = new PrintWriter(outputStream);
    CSlimes solver = new CSlimes();
    solver.solve(1, in, out);
    out.close();
  }

  static class CSlimes {

    public void solve(int testNumber, InputReader in, PrintWriter out) {
      int n = in.nextInt();
      char[] s = in.next().toCharArray();
      int ans = 0;
      char last = '0';
      for (int i = 0; i < n; ++i) {
        if (s[i] != last) {
          ++ans;
        }
        last = s[i];
      }
      out.println(ans);
    }

  }

  static interface FastInput {

  }

  static class InputReader implements FastInput {

    final private int BUFFER_SIZE = 1 << 16;
    private DataInputStream din;
    private byte[] buffer;
    private int bufferPointer;
    private int bytesRead;

    public InputReader(InputStream is) {
      din = new DataInputStream(is);
      buffer = new byte[BUFFER_SIZE];
      bufferPointer = bytesRead = 0;
    }

    public InputReader(String file_name) throws IOException {
      din = new DataInputStream(new FileInputStream(file_name));
      buffer = new byte[BUFFER_SIZE];
      bufferPointer = bytesRead = 0;
    }

    public String next() {
      StringBuilder sb = new StringBuilder();
      byte c = read();
      while (c <= ' ') {
        c = read();
      }
      while (isEmptySpace(c)) {
        sb.append((char) c);
        c = read();
      }
      return sb.toString();
    }

    private boolean isEmptySpace(byte c) {
      return c != ' ' && c != '\n' && c != '\t' && c != '\r';
    }

    public int nextInt() {
      int ret = 0;
      byte c = read();
      while (c <= ' ') {
        c = read();
      }
      boolean neg = (c == '-');
      if (neg) {
        c = read();
      }
      do {
        ret = ret * 10 + c - '0';
      } while ((c = read()) >= '0' && c <= '9');

      if (neg) {
        return -ret;
      }
      return ret;
    }

    private void fillBuffer() {
      try {
        bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
      } catch (IOException e) {
        throw new RuntimeException("trying to read from null input, verify constraints ");
      }
      if (bytesRead == -1) {
        buffer[0] = -1;
      }
    }

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

  }
}
//  [java]
import java.util.*;

public class Main {
	public static void main(String[] args) throws Exception{
		Scanner scn = new Scanner(System.in);
		int n = scn.nextInt();
      	String s = scn.next();
		String[] list = s.split("");
      	int count = 0;
		for(int i=0; i<n; i++){
			if(list[i].equals(list[i-1])) count++;
		}
      	System.out.println(n-count);
	}
}
//  [java]
import java.util.*;

public class Main {
	public static void main(String[] args) throws Exception{
		Scanner scn = new Scanner(System.in);
		int n = scn.nextInt();
      	String s = scn.next();
		String[] list = s.split("");
      	int count = 0;
		for(int i=0; i<n; i++){
			if(list[i].equals(a[i-1])) count++;
		}
      	System.out.println(n-count);
	}
}
//  [java]
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int count=1;
		for (int i=1;i<s.length();i++) {
			if (s.charAt(i)!=s.charAt(i-1)) {
				count ++;
			}
		}
		System.out.println(count);
	}
}
//  [cpp]
#include <cstdio>

const int MAXN=1e5+5;
char s[MAXN];

int main(){
	int n;
	scanf("%d%s",&n,s);
	int ans=0;
	char pre='\0';
	for(int i=0;i<n;++i){
		ans+=(pre!=s[i]);
		pre=s[i];
	}
	printf("%d",ans);
}
//  [cpp]
#include<stdio.h>

int main(){
    int N,ans=0;

    scanf("%d", &N);
    char S[100000];
    scanf("%s",S);
    for (int i = 0; i < N-1; i++){
        if (S[i] != S[i+1]){
            ans++;
        }
    }
    
    printf("%d\n",ans+1);
    return 0;
}
//  [cpp]
#pragma GCC optimize(2)
#include <bits/stdc++.h>
#define ll long long
using namespace std;

const int N = 1e5+10;
int n;
char s[N];

int main(){
    scanf("%d%s",&n,s);
    int ans = 1;
    for(int i=1;i<n;++i){
        if(s[i]!=s[i-1])    ans++;
    }

    cout << ans << '\n';
    return 0;
}
//  [cpp]
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <set>
#include <queue>
#include <map>
#include <algorithm>
#include <utility>
#include <cmath>
using namespace std;
using ll=long long;
using pint=pair<int,int>;
#define rep(i,a,b) for(ll i=a;i<ll(b);i++)
#define repr(i,a,b) for(ll i=a;i>=ll(b);i--)
#define el '\n'
#define ALL(x) x.begin(),x.end()
#define ALLR(x) x.rbegin(),x.rend()
#define ceil_div(a,b) ((a+(b-1))/b)
#define INF 1e9
#define DEBUG(x) cout<<"debug: "<<x<<endl
#define $in(v,n) ;rep(II,0,n)cin>>v[II]
inline void IN(void){return;}
template<typename F,typename... R>inline void IN(F& f, R&... r){cin>>f;IN(r...);}
template<class T>inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
template<class T>inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}


int main(){
    int n; string s; IN(n, s);
    int ans = 0;
    char old;
    rep(i, 0, n){
        if(s[i] != old) {
            ans++;
            old = s[i];
        }
    }
    cout << ans << el;
    return 0;
}
//  [cpp]
#include<stdio.h>
#include<iostream>
#include<string>
#include<memory>
#include<cmath>
#include<algorithm>
#include<vector>
#include<unordered_map>
double min_double(double a,double  b){
    if(a<b) return a;
    else return b;
}
void swap(int *x,int *y){
    int tmp;
    tmp=*x;
    *x=*y;  
    *y=tmp;
}
int gcd(int a,int b){
    if(a<b) swap(&a,&b);
    if(b<1) return -1;

    if(a%b==0) return b;
    return gcd(b,a%b);
}
int lcm(int a,int b){
    return a * b / gcd(a,b);
}

int main(){
    int N;
    std::cin>>N;
    std::string str;
    std::cin>>str;
    int ans=0;
    for(int i=0;i<N-1;i++){
        if(str[i]!=str[i+1]) ans++;
    }
    if(str[N-1]!=str[N-2]) ans++;
    if(ans==0) ans++;
    std::cout<<ans<<std::endl;
    return 0;
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;

int main()
{
    int n, res = 0;
    string a;
    cin >> n >> a;

    for(int i = 0; i < n - 1; ++i)
    {
        if(i == n - 2)
        {
            if(a[i] == a[i + 1]) 
                res++;
            else 
                res += 2;
        } else if(a[i] != a[i + 1])
        {
            res++;
        }
    }
    cout << res << "\n";
    return 0;
}
//  [c]
#include <stdio.h>

char S[100000];

void Do(int N){
  int i, c;
  scanf("%s", S);
  c = 1;
  for(i = 1;i < N;i++) if(S[i-1] != S[i]) c++;
  printf("%d\n", c);
}

int main(void){
  int N;
  scanf("%d", &N);
  Do(N);
  return 0;
}