import Foundation

func readString() -> String {
  return readLine()!
}
func readTokens() -> [String] {
  return readString().componentsSeparatedByString(" ")
}
func readIntArray() -> [Int] {
  return readTokens().map { Int($0)! }
}
func readInt() -> Int {
  return Int(readString())!
}
func readInt(n: Int) -> [Int] {
  return (0..<n).flatMap { _ in Int(readString())! }
}

extension String {
  var charArray: [String] {
    return characters.map { String($0) }
  }
  func intArray() -> [Int] {
    return charArray.flatMap { Int($0) }
  }
}

func printWitch<T>(b: Bool, l: T, r: T) {
  print(b ? l : r)
}

print(readString().intArray().filter( { $0 == 1 }).count)
