function writeDocument(variable){
document.write(variable+"<br/>");
}
str2="Rome was not built in a day";
var num=0;
var a=str2.match(/[a-zA-Z]/g)
for(i in a){
num++
}
document.write(num+"<br/>");
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<script>
</script>
</head>
<body>
</body>
</html>