#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define int long long
#define faster() ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
const int MOD = 1e9 + 7 ;
int n , m , s , t;
vector<int> ke[1005];
bool visited[1005] ;
int parent[1005];
int sz[1005];
int dfs(int u ){
visited[u] = true ;
int res = 1 ;
for(int v : ke[u]){
if(!visited[v]){
res += dfs(v);
}
}
return sz[u] = res ;
}
void solve(){
cin >> n ;
for(int i = 1 ; i <= n - 1 ; i++){
int x , y ; cin >> x >> y ;
ke[x].push_back(y);
ke[y].push_back(x);
}
dfs(1);
int sum = 0 ;
for(int i = 1 ; i <= n ; i++){
sum += sz[i];
}
cout << sum << endl;
}
signed main() {
faster();
int test = 1 ;
// cin >> test ;
while(test--) solve();
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CiNkZWZpbmUgZW5kbCAiXG4iCiNkZWZpbmUgaW50IGxvbmcgbG9uZwojZGVmaW5lIGZhc3RlcigpIGlvczo6c3luY193aXRoX3N0ZGlvKGZhbHNlKTsgY2luLnRpZShudWxscHRyKTsgY291dC50aWUobnVsbHB0cik7CmNvbnN0IGludCBNT0QgPSAxZTkgKyA3IDsKCmludCBuICAsIG0gLCBzICwgdDsKdmVjdG9yPGludD4ga2VbMTAwNV07CmJvb2wgdmlzaXRlZFsxMDA1XSA7CmludCBwYXJlbnRbMTAwNV07CmludCBzelsxMDA1XTsKaW50IGRmcyhpbnQgdSApewogICAgdmlzaXRlZFt1XSA9IHRydWUgOwogICAgaW50IHJlcyA9IDEgOwogICAgZm9yKGludCB2IDoga2VbdV0pewogICAgICAgIGlmKCF2aXNpdGVkW3ZdKXsKICAgICAgICAgICAgcmVzICs9IGRmcyh2KTsKICAgICAgICB9CiAgICB9CiAgICByZXR1cm4gc3pbdV0gPSByZXMgOwp9CgoKdm9pZCBzb2x2ZSgpewogICAgY2luID4+IG4gIDsKICAgIGZvcihpbn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