#include <algorithm>
#include <string>
#include <iostream>
int main() {
std::string str("hello\nworld\n");
std::cout << std::count(str.begin(), str.end(), '\n');
}
ICAgICNpbmNsdWRlIDxhbGdvcml0aG0+CiAgICAjaW5jbHVkZSA8c3RyaW5nPgogICAgI2luY2x1ZGUgPGlvc3RyZWFtPgoKICAgIGludCBtYWluKCkgewogICAgICAgIHN0ZDo6c3RyaW5nIHN0cigiaGVsbG9cbndvcmxkXG4iKTsKICAgICAgICBzdGQ6OmNvdXQgPDwgc3RkOjpjb3VudChzdHIuYmVnaW4oKSwgc3RyLmVuZCgpLCAnXG4nKTsKICAgIH0K