#include <iostream>
#include <cmath>
#include <algorithm>
#pragma GCC optimize("Ofast")
#define ll long long
#define ld long double
using namespace std;
signed main() {
const ll n = 3, m = 4;
ll cnt = 0, sum = 0;
ll a[n][m];
for(ll i = 0; i < n; i++)
for(ll j = 0; j < m;j++){
cin >> a[i][j];
if(a[i][j] > 0)
cnt++;
if(i == j)
sum += a[i][j];
}
cout << "Amount of positive elements is: " << cnt << "\n";
cout << "Sum of elements on the main diagonal is: " << sum;
}
cl=0.9;
var
s:string;
a,i:byte;
f:boolean;
begin
writeln('Введите ваше сообщение');
Readln(s);
a:=0;
i:=1;
while i<=length(s) do
begin
while (i<=length(s)) and (s[i]=' ') do inc(i);
f:=(i<=length(s)) and (s[i]<>' ');
while f do
begin
inc(a);
f:=false;
end;
while (i<=length(s)) and (s[i]<>' ') do inc(i);
end;
writeln('Количество слов - ', a);
writeln('Стоимость телеграммы ',t+cl*a,' руб');
end.