Problem:
Score : 100 points

Problem Statement

It has been decided that a programming contest sponsored by company A will be held, so we will post the notice on a bulletin board.

The bulletin board is in the form of a grid with N rows and N columns, and the notice will occupy a rectangular region with H rows and W columns.

How many ways are there to choose where to put the notice so that it completely covers exactly HW squares?

Constraints

1 \leq H, W \leq N \leq 100

All values in input are integers.

Input

Input is given from Standard Input in the following format:

N
H
W

Output

Print the answer.

Sample Input 1

3
2
3

Sample Output 1

2

There are two ways to put the notice, as follows:

### ...
### ###
... ###

Here, # represents a square covered by the notice, and . represents a square not covered.

Sample Input 2

100
1
1

Sample Output 2

10000

Sample Input 3

5
4
2

Sample Output 3

8

Solution in C++14 (GCC 5.4.1) (judge verdict: Wrong Answer)

#include <bits/stdc++.h>
#define REP(i, n) for (int i=0, i##_len=(n); i<i##_len; ++i)
#define FOR(i, a, b) for (int i=(a); i<(b); ++i)
using ll = long long;
using namespace std;

#define BL 1
#define WH 0
#define XX 2

int main()
{
    int H, W;
    cin >> H >> W;

    string S[H];
    REP(h, H) cin >> S[h];

    int board[H][W];
    REP(h, H) REP(w, W) board[h][w] = S[h][w] == '#';

    ll ret = 0;
    REP(h, H) REP(w, W)
    {
        if (board[h][w] != BL) continue;

        stack<pair<int,int>> nexts;
        nexts.push(make_pair(h, w));
        ll count[2] = {0};

        while (!nexts.empty())
        {
            pair<int,int> next = nexts.top();
            nexts.pop();

            int nh = next.first;
            int nw = next.second;
            if (board[nh][nw] == XX) continue;
            ++count[board[nh][nw]];

            if (nh-1 >= 0 && board[nh-1][nw] == !board[nh][nw]) nexts.push(make_pair(nh-1, nw));
            if (nh+1 <  H && board[nh+1][nw] == !board[nh][nw]) nexts.push(make_pair(nh+1, nw));
            if (nw-1 >= 0 && board[nh][nw-1] == !board[nh][nw]) nexts.push(make_pair(nh, nw-1));
            if (nw+1 <  W && board[nh][nw+1] == !board[nh][nw]) nexts.push(make_pair(nh, nw+1));

            board[nh][nw] = XX;
        }

        ret += count[WH]*count[BL];
    }

    cout << ret << endl;
    return 0;
}